Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for the Base Model for VO-DML 1.1 #62

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fc12769
first attempt at 1.1 base model
pahjbo Apr 1, 2023
86ae566
update with references - FIXME missing the extends on some primitives
pahjbo Apr 2, 2023
0fd86f8
remove the generated persistence.xml
pahjbo Apr 4, 2023
2d6ac7c
Merge branch 'master' into base_update
pahjbo Apr 17, 2023
981a2f1
add JPAManipulate implementations to hand written classes
pahjbo Apr 17, 2023
76d0c99
Merge branch 'master' into base_update
pahjbo Apr 17, 2023
a4d99b0
Merge branch 'master' into base_update
pahjbo Apr 27, 2023
f3c8e1d
Merge branch 'master' into base_update
pahjbo May 17, 2023
19c9b8f
couple of small tweaks from master that the merge did not capture
pahjbo May 17, 2023
f3c5c88
Merge branch 'master' into base_update
pahjbo May 23, 2023
a47ec44
Merge branch 'master' into base_update
pahjbo May 23, 2023
24eb14a
really want hand written Unit class
pahjbo May 23, 2023
0ade0d3
ignore python cache
pahjbo Aug 14, 2023
33faddd
Merge branch 'jakarta' into base_update
pahjbo Aug 14, 2023
898922a
update to jakarta
pahjbo Aug 14, 2023
09161b7
Merge branch 'master' into base_update
pahjbo Aug 21, 2023
6090ce9
Merge branch 'master' into base_update
pahjbo Dec 15, 2023
3e36348
specify string format of date.
pahjbo Dec 15, 2023
7edca1d
add in some initial "identifier types"
pahjbo Dec 18, 2023
2ba0882
Merge branch 'master' into base_update
pahjbo Dec 18, 2023
8f3fc5f
roll back some of the ideas for 1.1 a bit
pahjbo Dec 19, 2023
f657587
Merge branch 'master' into base_update
pahjbo Dec 19, 2023
d61dccb
don't auto convert vodsl
pahjbo Dec 19, 2023
1d9c0b4
Merge branch 'master' into base_update
pahjbo Dec 21, 2023
1634bbb
Merge branch 'master' into base_update
pahjbo Feb 8, 2024
a903f7d
Merge branch 'master' into base_update
pahjbo Feb 15, 2024
8527cc2
Merge branch 'master' into base_update
pahjbo Apr 8, 2024
f7002ef
Merge branch 'refs/heads/master' into base_update
pahjbo Apr 26, 2024
a8e2dc6
Merge branch 'refs/heads/master' into base_update
pahjbo May 16, 2024
d3fd4c5
Merge branch 'refs/heads/master' into base_update
pahjbo Jul 26, 2024
de6d39c
Merge branch 'refs/heads/master' into base_update
pahjbo Oct 7, 2024
b24ffa1
version 0.5.8
pahjbo Oct 17, 2024
b6c8434
Merge branch 'refs/heads/master' into base_update
pahjbo Oct 17, 2024
db7e3e6
needs to be api
pahjbo Oct 17, 2024
6b9a4df
Merge branch 'refs/heads/master' into base_update
pahjbo Oct 17, 2024
1962123
needs to be java 17
pahjbo Oct 17, 2024
0d4eb9b
Merge branch 'refs/heads/master' into base_update
pahjbo Nov 6, 2024
115c79c
remove the obsolete jpa_clone
pahjbo Nov 6, 2024
1ed7571
Unit has been extracted as a hand-written class
pahjbo Nov 7, 2024
f3fdbd2
ivoid rather than ivorn!
pahjbo Nov 19, 2024
c95f17d
Merge branch 'refs/heads/master' into base_update
pahjbo Nov 19, 2024
3f8ee6f
Merge branch 'refs/heads/master' into base_update
pahjbo Nov 19, 2024
35e41dc
Merge branch 'master' into base_update
pahjbo Feb 6, 2025
5971409
update to plugin 0.5.15
pahjbo Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tools/gradletooling/gradle-plugin/bin/
/tools/gradletooling/sample/allnav.yml
/tools/gradletooling/sample/pythontest/generated/
/tools/gradletooling/sample/mkdocs.yml
__pycache__/
/runtime/java/bin/
/tools/gradletooling/sample/tmp/
/tools/gradletooling/gradle-plugin/gradle/
19 changes: 17 additions & 2 deletions models/ivoa/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("net.ivoa.vo-dml.vodmltools") version "0.5.13"
id("net.ivoa.vo-dml.vodmltools") version "0.5.15"
// id ("com.diffplug.spotless") version "5.17.1"
`maven-publish`
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
Expand All @@ -9,14 +9,20 @@ plugins {


group = "org.javastro.ivoa.vo-dml"
version = "1.0-SNAPSHOT"
version = "1.1-SNAPSHOT"

vodml {
vodmlDir.set(file("vo-dml"))
vodslDir.set(file("model"))
bindingFiles.setFrom(file("vo-dml/ivoa_base.vodml-binding.xml"))
outputPythonDir.set(layout.projectDirectory.dir("../../tools/gradletooling/sample/pythontest/generated"))

}
/*
tasks.named("vodmlJavaGenerate") {
dependsOn("vodslToVodml")
}
*/

tasks.test {
useJUnitPlatform()
Expand All @@ -38,6 +44,15 @@ dependencies {
tasks.named<Jar>("jar") {
exclude("**/persistence.xml")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
withJavadocJar()
// withSourcesJar()
}


//publishing - IMPL would be nice to factor this out in some way....
nexusPublishing {
repositories {
Expand Down
36 changes: 36 additions & 0 deletions models/ivoa/model/IVOA-v1.0.vodsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

model ivoa (1.1) "This is the main reference data model containing primitive types used in other data models.
- note that this is an extended version for proposalDM including some identifier types that will hopefully make it into the main
release
"

primitive Unit -> string "Must conform to definition of unit in VOUnit spec."
primitive anyURI -> string "Represents a URI in the same way as the datatype of the same nam in XML Schema is used."
primitive boolean "The standard boolean, having values true or false."
primitive complex "Represents a complex number, consisting of a real and imaginary component, both of which are reals. Note that in many contexts there is no native mapping for this type and it must be treated with a custom mapping."
primitive datetime "Represents a moment in time using a date+timestamp - string serialization to conform to ISO 8601"
primitive integer "An integer number (from Z)."
primitive nonnegativeInteger "An integer number from N, therefore greater than or equal to 0."
primitive rational "A rational number from Q, represented by two integers, a numerator and a denominator. A native mapping to a serialisation context does in general not exists."
primitive real "A real number (from R)."
primitive string "A string, represented as an array of characters treated as a single, primitive value. Ala Java, a string can not be updated, that is any update leads to a different string. However in contrast to Java we assume that two strings that are identical in all their constitutent characters are the same.
I.e. string has value type semantics."
dtype IntegerQuantity -> Quantity "An integer number with a unit. Examples of such units that can be used for attributes are bit/byte/kiloByte etc."
{
value: integer "The integer value of this IntegerQuantity.";
}

abstract dtype Quantity "Meant to represent the value of a numerical physical quantity.
Can be mapped in VOTables to FIELDrefs and PARAM(ref)s, in which case the @unit attribute of those VOTable elements is assumed to be mapped to the attribute on the Quantity.
Ths is only allowed for these predefined ivoa types."
{
unit: Unit @? "The unit of this quantity.";
}

dtype RealQuantity -> Quantity "A real value with a unit."
{
value: real "The real value of this quantity";
}
primitive intIdentifier -> integer "an integer identifier that can be used as a key for lookup of an entity that is *outside this datamodel*"
primitive stringIdentifier -> string "a string identifier that can be used as a key for lookup of an entity that is *outside this datamodel*"
primitive ivoid -> anyURI "an identifier that can be used as a key to look up in an IVOA registry - see https://www.ivoa.net/documents/IVOAIdentifiers/"
14 changes: 13 additions & 1 deletion models/ivoa/src/main/java/org/ivoa/vodml/stdtypes/Complex.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.ivoa.vodml.annotation.VoDml;
import org.ivoa.vodml.annotation.VodmlRole;
import org.ivoa.vodml.jpa.JPAManipulations;

/**
* UML PrimitiveType complex : Represents a complex number, consisting of a real
Expand All @@ -17,7 +18,7 @@
*/
@VoDml(id = "ivoa:complex", role=VodmlRole.primitiveType, type="ivoa:complex")
@Embeddable
public class Complex {
public class Complex implements JPAManipulations {

/** string representation */
private double re;
Expand Down Expand Up @@ -78,4 +79,15 @@ public void setRe(double re) {
public void setIm(double im) {
this.im = im;
}

@Override
public void forceLoad() {
// nothing to do
}


@Override
public void persistRefs(EntityManager em) {
// nothing to do.
}
}
15 changes: 14 additions & 1 deletion models/ivoa/src/main/java/org/ivoa/vodml/stdtypes/Duration.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.ivoa.vodml.annotation.VoDml;
import org.ivoa.vodml.annotation.VodmlRole;
import org.ivoa.vodml.jpa.JPAManipulations;

import jakarta.persistence.*;

Expand All @@ -20,7 +21,7 @@
*/
@Embeddable
@VoDml(id = "ivoa:duration", role=VodmlRole.primitiveType, type = "ivoa:duration" )
public class Duration {
public class Duration implements JPAManipulations {
//TODO not sure that this is the best representation - PAH - better to use java internal type esp. JDK8+
/** string representation */
private Date from;
Expand Down Expand Up @@ -58,4 +59,16 @@ public Date getTo() {
public void setTo(Date to) {
this.to = to;
}

@Override
public void forceLoad() {
// nothing to do
}



@Override
public void persistRefs(EntityManager em) {
// nothing to do.
}
}
14 changes: 13 additions & 1 deletion models/ivoa/src/main/java/org/ivoa/vodml/stdtypes/Rational.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.ivoa.vodml.annotation.VoDml;
import org.ivoa.vodml.annotation.VodmlRole;
import org.ivoa.vodml.jpa.JPAManipulations;

/**
* UML DataType rational : A rational number from Q, represented by two
Expand All @@ -16,7 +17,7 @@
*/
@VoDml(id = "ivoa:rational", role=VodmlRole.primitiveType, type="ivoa:rational")
@Embeddable
public class Rational {
public class Rational implements JPAManipulations {

private int numerator;
private int denominator;
Expand Down Expand Up @@ -73,4 +74,15 @@ public int getDenominator() {
public void setDenominator(int denominator) {
this.denominator = denominator;
}

@Override
public void forceLoad() {
// nothing to do
}


@Override
public void persistRefs(EntityManager em) {
// nothing to do.
}
}
71 changes: 71 additions & 0 deletions models/ivoa/src/main/java/org/ivoa/vodml/stdtypes/Unit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

package org.ivoa.vodml.stdtypes;



/**
* Must conform to definition of unit in VOUnit spec.
* PrimitiveType Unit :
*
* @author generated by https://github.com/ivoa/vo-dml tools
*/

@org.ivoa.vodml.annotation.VoDml(id="ivoa:Unit", role=org.ivoa.vodml.annotation.VodmlRole.primitiveType)


@org.eclipse.microprofile.openapi.annotations.media.Schema(description="Must conform to definition of unit in VOUnit spec.")
@jakarta.persistence.Embeddable

@jakarta.xml.bind.annotation.XmlType( name = "Unit")

public class Unit implements java.io.Serializable {

private static final long serialVersionUID = 1L;

/** representation */
@jakarta.xml.bind.annotation.XmlValue
private String value;

/**
* Creates a new Unit Primitive Type instance, wrapping a base type.
*
* @param v the base object.
*/
public Unit(final String v) {
this.value = v;
}
/**
* no arg constructor.
*/
protected Unit() {}

/**
* copy constructor.
* @param c the object to be copied.
*/
public Unit(Unit c)
{
this(c.value);
}

/**
* Return the representation of this primitive (value)
* @return string representation of this primitive( value)
*/
public final String value() {
return this.value;
}

/**
* Return the string representation of this primitive value
* @see #value()
* @return string representation of this primitive
*/
@Override
public final String toString() {
return value().toString();
}


}

Loading
Loading