Commit 4bebc3dc authored by Jay Jay Billings's avatar Jay Jay Billings
Browse files

Renamed/scoped the ICE data ontology namespace to be more precise.


Signed-off-by: default avatarJay Jay Billings <billingsjj@ornl.gov>
parent aa8d22e9
......@@ -101,11 +101,11 @@ public class ComponentBuilder {
public ComponentBuilder(final OntModel ICEOntModel) {
ontModel = ICEOntModel;
// Grab all the properties for fast references
compClass = ontModel.getOntClass(ICEConstants.COMPONENT);
nameProp = ontModel.getObjectProperty(ICEConstants.NAME);
descProp = ontModel.getObjectProperty(ICEConstants.DESCRIPTION);
contextProp = ontModel.getObjectProperty(ICEConstants.CONTEXT);
idProp = ontModel.getObjectProperty(ICEConstants.ID);
compClass = ontModel.getOntClass(ICEDataConstants.COMPONENT);
nameProp = ontModel.getObjectProperty(ICEDataConstants.NAME);
descProp = ontModel.getObjectProperty(ICEDataConstants.DESCRIPTION);
contextProp = ontModel.getObjectProperty(ICEDataConstants.CONTEXT);
idProp = ontModel.getObjectProperty(ICEDataConstants.ID);
// Set the default values.
clear();
......
......@@ -21,7 +21,7 @@ import org.apache.jena.rdf.model.Property;
* @author Jay Jay Billings
*
*/
public class ICEConstants {
public class ICEDataConstants {
/**
* A private model used for creating property and resource references.
......@@ -31,7 +31,7 @@ public class ICEConstants {
/**
* Root Namespace of the ICE ontology
*/
public static String NAMESPACE = "https://www.eclipse.org/ice#";
public static String NAMESPACE = "https://www.eclipse.org/ice/data#";
/**
* Fully qualified type name of ICE Components
......
......@@ -5,16 +5,16 @@
@prefix co: <http://purl.org/co> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ice: <https://www.eclipse.org/ice#> .
@prefix ice-data: <https://www.eclipse.org/ice/data#> .
<https://www.eclipse.org/ice#Identifiable>
<https://www.eclipse.org/ice/data#Identifiable>
a owl:Class ;
rdfs:comment """This class describes objects that
are identifiable to ICE."""@en ;
rdfs:label "Identifiable"@en ;
rdfs:subClassOf owl:Thing .
<https://www.eclipse.org/ice#context>
<https://www.eclipse.org/ice/data#context>
a owl:ObjectProperty ;
rdfs:comment """The context can be thought of as
an additional clue that can be provided with the object to allow
......@@ -23,7 +23,7 @@
rdfs:label "context"@en ;
rdfs:range owl:AnnotationProperty .
<https://www.eclipse.org/ice#identifier>
<https://www.eclipse.org/ice/data#identifier>
a owl:ObjectProperty ;
rdfs:comment """A unique identifier for the
object."""@en ;
......@@ -31,7 +31,7 @@
rdfs:label "id"@en ;
rdfs:range xsd:long .
<https://www.eclipse.org/ice#name>
<https://www.eclipse.org/ice/data#name>
a owl:ObjectProperty ;
rdfs:comment """The name that should be given to
the Identifiable entity."""@en ;
......@@ -39,7 +39,7 @@
rdfs:label "name"@en ;
rdfs:range xsd:string .
<https://www.eclipse.org/ice#desc>
<https://www.eclipse.org/ice/data#desc>
a owl:ObjectProperty ;
rdfs:comment """The description that should be
given to the Identifiable entity."""@en ;
......@@ -47,7 +47,7 @@
rdfs:label "description"@en ;
rdfs:range xsd:string .
<https://www.eclipse.org/ice#Component>
<https://www.eclipse.org/ice/data#Component>
a owl:Class ;
rdfs:comment """Components are special types of
Identifiables that manage or share data, and which act as nodes in
......@@ -55,7 +55,7 @@
rdfs:label "Component"@en ;
rdfs:subClassOf <https://www.eclipse.org/ice#Identifiable> .
<https://www.eclipse.org/ice#Composite>
<https://www.eclipse.org/ice/data#Composite>
a owl:Class ;
rdfs:comment """Composites hold collections of
Components to store data and are the root and parent nodes in the
......@@ -63,14 +63,14 @@
rdfs:label "Composite"@en ;
rdfs:subClassOf <https://www.eclipse.org/ice#Component> .
<https://www.eclipse.org/ice#ComponentList>
<https://www.eclipse.org/ice/data#ComponentList>
a owl:Class ;
rdfs:comment """The list of components associated
with the composite."""@en ;
rdfs:label "ComponentList"@en ;
rdfs:subClassOf <http://purl.org/co#Set>.
<https://www.eclipse.org/ice#ComponentListShape>
<https://www.eclipse.org/ice/data#ComponentListShape>
a sh:NodeShape ;
sh:targetClass <https://www.eclipse.org/ice#ComponentList> ;
sh:property [
......@@ -81,7 +81,7 @@
sh:closed true ;
sh:ignoredProperties (rdf:type) .
<https://www.eclipse.org/ice#componentListProperty>
<https://www.eclipse.org/ice/data#componentListProperty>
a owl:ObjectProperty ;
rdfs:comment """The link between the Composite and
ComponentList."""@en ;
......
......@@ -20,7 +20,7 @@ import org.apache.jena.rdf.model.ModelFactory;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.util.FileManager;
import org.eclipse.ice.data.ComponentBuilder;
import org.eclipse.ice.data.ICEConstants;
import org.eclipse.ice.data.ICEDataConstants;
import org.junit.BeforeClass;
import org.junit.Test;
......@@ -78,15 +78,15 @@ public class ComponentBuilderTest {
// Check the deets, namespace first
assertEquals(namespace, comp.getNameSpace());
// name
assertEquals(name, comp.getProperty(ICEConstants.NAME_PROPERTY).getObject().toString());
assertEquals(name, comp.getProperty(ICEDataConstants.NAME_PROPERTY).getObject().toString());
// context
assertEquals(context,
comp.getProperty(ICEConstants.CONTEXT_PROPERTY).getObject().toString());
comp.getProperty(ICEDataConstants.CONTEXT_PROPERTY).getObject().toString());
// description
assertEquals(desc, comp.getProperty(ICEConstants.DESC_PROPERTY).getObject().toString());
assertEquals(desc, comp.getProperty(ICEDataConstants.DESC_PROPERTY).getObject().toString());
// id
assertEquals(id,
comp.getProperty(ICEConstants.ID_PROPERTY).getObject().asLiteral().getLong());
comp.getProperty(ICEDataConstants.ID_PROPERTY).getObject().asLiteral().getLong());
// Have a look at it
dataModel.write(System.out, "TURTLE");
......@@ -117,15 +117,15 @@ public class ComponentBuilderTest {
// Check the deets, namespace first
assertEquals(namespace, comp.getNameSpace());
// name
assertEquals(name, comp.getProperty(ICEConstants.NAME_PROPERTY).getObject().toString());
assertEquals(name, comp.getProperty(ICEDataConstants.NAME_PROPERTY).getObject().toString());
// context
assertEquals(context,
comp.getProperty(ICEConstants.CONTEXT_PROPERTY).getObject().toString());
comp.getProperty(ICEDataConstants.CONTEXT_PROPERTY).getObject().toString());
// description
assertEquals(desc, comp.getProperty(ICEConstants.DESC_PROPERTY).getObject().toString());
assertEquals(desc, comp.getProperty(ICEDataConstants.DESC_PROPERTY).getObject().toString());
// id
assertEquals(id,
comp.getProperty(ICEConstants.ID_PROPERTY).getObject().asLiteral().getLong());
comp.getProperty(ICEDataConstants.ID_PROPERTY).getObject().asLiteral().getLong());
// Have a look at it
dataModel.write(System.out, "TURTLE");
......@@ -157,15 +157,15 @@ public class ComponentBuilderTest {
// Check the deets, namespace first
assertEquals(namespace, comp.getNameSpace());
// name
assertEquals(name, comp.getProperty(ICEConstants.NAME_PROPERTY).getObject().toString());
assertEquals(name, comp.getProperty(ICEDataConstants.NAME_PROPERTY).getObject().toString());
// context
assertEquals(context,
comp.getProperty(ICEConstants.CONTEXT_PROPERTY).getObject().toString());
comp.getProperty(ICEDataConstants.CONTEXT_PROPERTY).getObject().toString());
// description
assertEquals(desc, comp.getProperty(ICEConstants.DESC_PROPERTY).getObject().toString());
assertEquals(desc, comp.getProperty(ICEDataConstants.DESC_PROPERTY).getObject().toString());
// id
assertEquals(id,
comp.getProperty(ICEConstants.ID_PROPERTY).getObject().asLiteral().getLong());
comp.getProperty(ICEDataConstants.ID_PROPERTY).getObject().asLiteral().getLong());
// Build the component
iri = namespace + "Comp2";
......@@ -175,15 +175,15 @@ public class ComponentBuilderTest {
// Check the deets, namespace first
assertEquals(namespace, resetComp.getNameSpace());
// name
assertEquals(defaultName, resetComp.getProperty(ICEConstants.NAME_PROPERTY).getObject().toString());
assertEquals(defaultName, resetComp.getProperty(ICEDataConstants.NAME_PROPERTY).getObject().toString());
// context
assertEquals(defaultContext,
resetComp.getProperty(ICEConstants.CONTEXT_PROPERTY).getObject().toString());
resetComp.getProperty(ICEDataConstants.CONTEXT_PROPERTY).getObject().toString());
// description
assertEquals(defaultDesc, resetComp.getProperty(ICEConstants.DESC_PROPERTY).getObject().toString());
assertEquals(defaultDesc, resetComp.getProperty(ICEDataConstants.DESC_PROPERTY).getObject().toString());
// id
assertEquals(defaultId,
resetComp.getProperty(ICEConstants.ID_PROPERTY).getObject().asLiteral().getLong());
resetComp.getProperty(ICEDataConstants.ID_PROPERTY).getObject().asLiteral().getLong());
// Have a look at it
dataModel.write(System.out, "TURTLE");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment