Class Ontology
java.lang.Object
net.simplace.sim.util.ontology.Ontology
Access to the OM ontology (Ontology of units of Measure, version 1.8), used to resolve unit URIs of variables
into names, symbols and descriptions.
The ontology is read from OM_18.rdf on the classpath or, if missing, from
http://simplace.net/dtd/OM_18.rdf. If it cannot be read, the ontology is inactive and the methods return
the last part of the URI instead.
The home page of the OM ontology is: http://www.wurvoc.org/vocabularies/om-1.8/
- Author:
- Andreas Enders, Crop Science Group, Katzenburgweg 5, 53115 Bonn, Germany IMPETUS Project, www.impetus.uni-koeln.de Contact Information: info@andreas-enders.de
-
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.jena.rdf.model.Statement> allInstances(String aURI) Returns all statements (properties) of an ontology resource.getDescription(String aURI) Returns the definition (om:definition) of a unit.static OntologyReturns the singleton instance; the ontology is read on the first call.getProperty(String aURI, org.apache.jena.rdf.model.Property aProperty, boolean aCheckForLang) Returns the value of a property of an ontology resource.getStandardName(String aURI) Returns the English label (rdfs:label) of a unit.Returns the symbol (om:symbol) of a unit.static voidTest: prints the symbol and all properties of the unit metre.
-
Method Details
-
getInstance
Returns the singleton instance; the ontology is read on the first call.- Returns:
- the ontology
-
main
Test: prints the symbol and all properties of the unit metre.- Parameters:
args- not used
-
getProperty
public String getProperty(String aURI, org.apache.jena.rdf.model.Property aProperty, boolean aCheckForLang) Returns the value of a property of an ontology resource. If the ontology is inactive or the resource has no such property, the last part of the URI is returned (a warning is logged in the second case).- Parameters:
aURI- URI of the resource (e.g. a unit)aProperty- the property to readaCheckForLang-trueto return the English (en) value (the first value if there is no English one),falsefor the first value- Returns:
- the property value
-
getStandardName
Returns the English label (rdfs:label) of a unit.- Parameters:
aURI- URI of the unit- Returns:
- the name of the unit, see
getProperty(String, Property, boolean)
-
getSymbol
Returns the symbol (om:symbol) of a unit.- Parameters:
aURI- URI of the unit- Returns:
- the symbol of the unit, see
getProperty(String, Property, boolean)
-
getDescription
-
allInstances
-