|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.smi.protegex.owl.jena.Jena
A collection of static utility methods for Jena.
Nested Class Summary | |
protected static class |
Jena.ObjectMapper
|
Field Summary | |
static String |
DEFAULT_NAMESPACE_SEPARATOR
|
static String |
DEFAULT_ONT_POLICY_FILE_PATH
|
static String |
ONT_POLICY_PROPERTY
|
static String |
OWL_DL
|
static String |
OWL_FULL
|
static String |
OWL_LITE
|
static String |
ROOT_FOLDER
Deprecated. use ProtegeOWL.PLUGIN_FOLDER instead |
private static Set |
systemClasses
|
static String |
XML_TAG_HIDDEN_PROPERTY
|
Constructor Summary | |
Jena()
|
Method Summary | |
static com.hp.hpl.jena.rdf.model.Model |
addOWLFullModel(com.hp.hpl.jena.ontology.OntModel ontModel)
Simulates the import of the OWL/RDFS meta ontologies. |
private static void |
addRDFTypes(Hashtable table,
com.hp.hpl.jena.ontology.OntProperty property)
|
static com.hp.hpl.jena.ontology.DatatypeProperty |
asDatatypeProperty(com.hp.hpl.jena.rdf.model.Resource resource)
|
static com.hp.hpl.jena.ontology.ObjectProperty |
asObjectProperty(com.hp.hpl.jena.rdf.model.Resource resource)
|
static com.hp.hpl.jena.ontology.OntClass |
asOntClass(com.hp.hpl.jena.rdf.model.Resource resource)
|
static com.hp.hpl.jena.ontology.OntProperty |
asOntProperty(com.hp.hpl.jena.rdf.model.Resource resource)
|
static boolean |
canAs(com.hp.hpl.jena.rdf.model.RDFNode resource,
com.hp.hpl.jena.rdf.model.Resource type)
Checks whether a given OntResource has a certain rdf:type, or a subclass thereof. |
static boolean |
canAsDatatypeProperty(com.hp.hpl.jena.rdf.model.RDFNode resource)
|
static boolean |
canAsObjectProperty(com.hp.hpl.jena.rdf.model.RDFNode resource)
|
static boolean |
canAsOntClass(com.hp.hpl.jena.rdf.model.RDFNode resource)
|
static boolean |
canAsOntProperty(com.hp.hpl.jena.rdf.model.RDFNode resource)
|
static boolean |
canAsOWLProperty(com.hp.hpl.jena.rdf.model.RDFNode resource)
|
static Iterator |
cloneIt(Iterator it)
Just creates a cloning Iterator to avoid concurrent modification exceptions. |
static com.hp.hpl.jena.ontology.OntModel |
cloneOntModel(com.hp.hpl.jena.ontology.OntModel oldModel)
|
static com.hp.hpl.jena.ontology.OntModel |
cloneOntModel(com.hp.hpl.jena.ontology.OntModel oldModel,
com.hp.hpl.jena.ontology.OntModelSpec spec)
|
static Hashtable |
convertTypedAnnotationPropertiesIntoUntyped(com.hp.hpl.jena.ontology.OntModel ontModel)
|
static void |
copyPropertyValues(com.hp.hpl.jena.rdf.model.Resource from,
com.hp.hpl.jena.rdf.model.Resource to)
|
static void |
dumpRDF(com.hp.hpl.jena.ontology.OntModel ontModel)
|
static void |
dumpRDF(com.hp.hpl.jena.ontology.OntModel ontModel,
OutputStream stream)
|
static void |
dumpRDFTopLevel(com.hp.hpl.jena.ontology.OntModel ontModel)
|
static void |
ensureOWLFullModelIsLastModel(com.hp.hpl.jena.ontology.OntModel ontModel,
com.hp.hpl.jena.rdf.model.Model owlFullModel)
|
private static com.hp.hpl.jena.rdf.model.Resource |
getBestType(com.hp.hpl.jena.ontology.OntResource resource)
|
static com.hp.hpl.jena.ontology.Ontology |
getDefaultJenaOntology(String namespace,
com.hp.hpl.jena.ontology.OntModel ontModel)
|
static Collection |
getDirectSubClasses(com.hp.hpl.jena.ontology.OntClass ontClass)
Gets the direct subclasses of a given OntClass, excluding the class itself which is usually delivered by Jena. |
static Collection |
getDirectSuperClasses(com.hp.hpl.jena.ontology.OntClass ontClass)
Gets the direct superclasses of a given OntClass, excluding the class itself which is usually delivered by Jena. |
static com.hp.hpl.jena.graph.Graph |
getHomeGraph(com.hp.hpl.jena.ontology.OntModel ontModel,
com.hp.hpl.jena.ontology.OntResource resource)
Gets the Graph where the rdf:type statement of a certain resource is. |
static String |
getImportSource(com.hp.hpl.jena.ontology.OntModel ontModel,
com.hp.hpl.jena.ontology.OntResource resource)
|
static String |
getNamespaceFromURI(String namespace)
|
static String |
getNamespaceWithoutSeparator(String namespace)
|
static String |
getOntPolicyFilePath(edu.stanford.smi.protege.model.Project project)
Deprecated. |
static int |
getOWLSpecies(com.hp.hpl.jena.ontology.OntModel ontModel)
|
static String |
getOWLSpeciesString(int x)
|
static com.hp.hpl.jena.rdf.model.RDFNode |
getPropertyValue(com.hp.hpl.jena.rdf.model.Resource resource,
com.hp.hpl.jena.rdf.model.Property property)
|
static String |
getURIFromNamespace(String namespace)
|
static boolean |
isDatatypeProperty(com.hp.hpl.jena.ontology.OntModel ontModel,
com.hp.hpl.jena.ontology.OntProperty ontProperty)
|
static boolean |
isImportedResource(com.hp.hpl.jena.ontology.OntModel ontModel,
com.hp.hpl.jena.rdf.model.Model owlFullModel,
com.hp.hpl.jena.ontology.OntResource ontResource)
|
static boolean |
isNamespaceWithSeparator(String str)
|
static boolean |
isObjectProperty(com.hp.hpl.jena.ontology.OntModel ontModel,
com.hp.hpl.jena.ontology.OntProperty ontProperty)
|
static boolean |
isSystemClass(com.hp.hpl.jena.ontology.OntClass ontClass)
|
static boolean |
isSystemProperty(com.hp.hpl.jena.ontology.OntProperty property)
|
static boolean |
isSystemResource(com.hp.hpl.jena.rdf.model.Resource ontResource)
|
static boolean |
isValidNamespace(String text)
|
static boolean |
isXMLLanguage(String language)
|
static boolean |
isXMLTagHidden()
|
static com.hp.hpl.jena.rdf.model.NodeIterator |
listPropertyValues(com.hp.hpl.jena.rdf.model.Resource resource,
com.hp.hpl.jena.rdf.model.Property property)
|
static boolean |
namespaceEndsWithSeparator(String namespace)
|
static void |
prepareWriter(com.hp.hpl.jena.rdf.model.RDFWriter writer,
String language,
String namespace)
|
static void |
removePropertyValue(com.hp.hpl.jena.ontology.OntResource resource,
com.hp.hpl.jena.rdf.model.Property property,
String value)
A convenience method that removes a property value with a given toString serialization from an OntResource. |
static void |
removePropertyValue(com.hp.hpl.jena.rdf.model.Resource resource,
com.hp.hpl.jena.rdf.model.Property property,
com.hp.hpl.jena.rdf.model.RDFNode value)
|
static com.hp.hpl.jena.rdf.model.Resource |
renameResource(com.hp.hpl.jena.ontology.OntModel ontModel,
com.hp.hpl.jena.rdf.model.Resource old,
String uri)
|
static com.hp.hpl.jena.rdf.model.Resource |
renameResource(com.hp.hpl.jena.rdf.model.Resource old,
String uri,
com.hp.hpl.jena.rdf.model.Model owlFullModel)
Deprecated. this has a bug (it does not rename the resource in all models) - use the other renameResource method instead |
static void |
renameResourceInGraph(com.hp.hpl.jena.graph.Graph graph,
com.hp.hpl.jena.rdf.model.Resource old,
com.hp.hpl.jena.rdf.model.Resource newResource)
|
static void |
renameResourceInModel(com.hp.hpl.jena.rdf.model.Model m,
com.hp.hpl.jena.rdf.model.Resource old,
com.hp.hpl.jena.rdf.model.Resource newResource)
Deprecated. wrong |
static void |
saveOntModel(OWLModel owlModel,
File file,
com.hp.hpl.jena.ontology.OntModel owldlOntModel,
String message)
|
static Set |
set(Iterator it)
Converts an Iterator (e.g. those delivered by the Jena listXXX methods) into a List. |
static void |
set(Set set,
Iterator it)
Converts an Iterator (e.g. those delivered by the Jena listXXX methods) into a List. |
static void |
setOntPolicyFilePath(edu.stanford.smi.protege.model.Project project,
String path)
Deprecated. |
static void |
setXMLTagHidden(boolean value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String DEFAULT_NAMESPACE_SEPARATOR
public static final String OWL_DL
public static final String OWL_FULL
public static final String OWL_LITE
public static final String XML_TAG_HIDDEN_PROPERTY
private static final Set systemClasses
public static final String ROOT_FOLDER
public static final String DEFAULT_ONT_POLICY_FILE_PATH
public static final String ONT_POLICY_PROPERTY
Constructor Detail |
public Jena()
Method Detail |
private static void addRDFTypes(Hashtable table, com.hp.hpl.jena.ontology.OntProperty property)
public static com.hp.hpl.jena.ontology.DatatypeProperty asDatatypeProperty(com.hp.hpl.jena.rdf.model.Resource resource)
public static com.hp.hpl.jena.ontology.OntClass asOntClass(com.hp.hpl.jena.rdf.model.Resource resource)
public static com.hp.hpl.jena.ontology.ObjectProperty asObjectProperty(com.hp.hpl.jena.rdf.model.Resource resource)
public static com.hp.hpl.jena.ontology.OntProperty asOntProperty(com.hp.hpl.jena.rdf.model.Resource resource)
public static boolean canAs(com.hp.hpl.jena.rdf.model.RDFNode resource, com.hp.hpl.jena.rdf.model.Resource type)
resource
- type
-
public static boolean canAsDatatypeProperty(com.hp.hpl.jena.rdf.model.RDFNode resource)
public static boolean canAsOntClass(com.hp.hpl.jena.rdf.model.RDFNode resource)
public static boolean canAsObjectProperty(com.hp.hpl.jena.rdf.model.RDFNode resource)
public static boolean canAsOntProperty(com.hp.hpl.jena.rdf.model.RDFNode resource)
public static boolean canAsOWLProperty(com.hp.hpl.jena.rdf.model.RDFNode resource)
public static Iterator cloneIt(Iterator it)
it
- the source Iterator
public static com.hp.hpl.jena.ontology.OntModel cloneOntModel(com.hp.hpl.jena.ontology.OntModel oldModel)
public static com.hp.hpl.jena.ontology.OntModel cloneOntModel(com.hp.hpl.jena.ontology.OntModel oldModel, com.hp.hpl.jena.ontology.OntModelSpec spec)
public static Hashtable convertTypedAnnotationPropertiesIntoUntyped(com.hp.hpl.jena.ontology.OntModel ontModel)
public static void copyPropertyValues(com.hp.hpl.jena.rdf.model.Resource from, com.hp.hpl.jena.rdf.model.Resource to)
public static void dumpRDF(com.hp.hpl.jena.ontology.OntModel ontModel)
public static void dumpRDF(com.hp.hpl.jena.ontology.OntModel ontModel, OutputStream stream)
public static void dumpRDFTopLevel(com.hp.hpl.jena.ontology.OntModel ontModel)
public static com.hp.hpl.jena.rdf.model.Model addOWLFullModel(com.hp.hpl.jena.ontology.OntModel ontModel)
ontModel
- the OntModel to add a new sub model
public static void ensureOWLFullModelIsLastModel(com.hp.hpl.jena.ontology.OntModel ontModel, com.hp.hpl.jena.rdf.model.Model owlFullModel)
public static com.hp.hpl.jena.graph.Graph getHomeGraph(com.hp.hpl.jena.ontology.OntModel ontModel, com.hp.hpl.jena.ontology.OntResource resource)
ontModel
- the OntModelresource
- the Resource to look up
public static String getImportSource(com.hp.hpl.jena.ontology.OntModel ontModel, com.hp.hpl.jena.ontology.OntResource resource)
public static int getOWLSpecies(com.hp.hpl.jena.ontology.OntModel ontModel)
public static String getOWLSpeciesString(int x)
public static String getNamespaceFromURI(String namespace)
public static String getNamespaceWithoutSeparator(String namespace)
public static String getURIFromNamespace(String namespace)
public static boolean isDatatypeProperty(com.hp.hpl.jena.ontology.OntModel ontModel, com.hp.hpl.jena.ontology.OntProperty ontProperty)
public static boolean isImportedResource(com.hp.hpl.jena.ontology.OntModel ontModel, com.hp.hpl.jena.rdf.model.Model owlFullModel, com.hp.hpl.jena.ontology.OntResource ontResource)
private static com.hp.hpl.jena.rdf.model.Resource getBestType(com.hp.hpl.jena.ontology.OntResource resource)
public static boolean isNamespaceWithSeparator(String str)
public static boolean isObjectProperty(com.hp.hpl.jena.ontology.OntModel ontModel, com.hp.hpl.jena.ontology.OntProperty ontProperty)
public static boolean isSystemProperty(com.hp.hpl.jena.ontology.OntProperty property)
public static boolean isSystemResource(com.hp.hpl.jena.rdf.model.Resource ontResource)
public static boolean isSystemClass(com.hp.hpl.jena.ontology.OntClass ontClass)
public static boolean isValidNamespace(String text)
public static boolean isXMLLanguage(String language)
public static boolean isXMLTagHidden()
public static boolean namespaceEndsWithSeparator(String namespace)
public static void prepareWriter(com.hp.hpl.jena.rdf.model.RDFWriter writer, String language, String namespace)
public static void removePropertyValue(com.hp.hpl.jena.ontology.OntResource resource, com.hp.hpl.jena.rdf.model.Property property, String value)
resource
- the OntResource to remove the property value fromproperty
- the Property to remove a value ofvalue
- the toString value to removepublic static com.hp.hpl.jena.rdf.model.Resource renameResource(com.hp.hpl.jena.rdf.model.Resource old, String uri, com.hp.hpl.jena.rdf.model.Model owlFullModel)
public static com.hp.hpl.jena.rdf.model.Resource renameResource(com.hp.hpl.jena.ontology.OntModel ontModel, com.hp.hpl.jena.rdf.model.Resource old, String uri)
public static void renameResourceInGraph(com.hp.hpl.jena.graph.Graph graph, com.hp.hpl.jena.rdf.model.Resource old, com.hp.hpl.jena.rdf.model.Resource newResource)
public static void renameResourceInModel(com.hp.hpl.jena.rdf.model.Model m, com.hp.hpl.jena.rdf.model.Resource old, com.hp.hpl.jena.rdf.model.Resource newResource)
public static void saveOntModel(OWLModel owlModel, File file, com.hp.hpl.jena.ontology.OntModel owldlOntModel, String message)
public static Set set(Iterator it)
it
- the Iterator to convert
public static void set(Set set, Iterator it)
it
- the Iterator to convertpublic static void setXMLTagHidden(boolean value)
public static com.hp.hpl.jena.rdf.model.RDFNode getPropertyValue(com.hp.hpl.jena.rdf.model.Resource resource, com.hp.hpl.jena.rdf.model.Property property)
public static com.hp.hpl.jena.rdf.model.NodeIterator listPropertyValues(com.hp.hpl.jena.rdf.model.Resource resource, com.hp.hpl.jena.rdf.model.Property property)
public static Collection getDirectSubClasses(com.hp.hpl.jena.ontology.OntClass ontClass)
ontClass
- the OntClass to get the subclasses of
public static Collection getDirectSuperClasses(com.hp.hpl.jena.ontology.OntClass ontClass)
ontClass
- the OntClass to get the superclasses of
public static com.hp.hpl.jena.ontology.Ontology getDefaultJenaOntology(String namespace, com.hp.hpl.jena.ontology.OntModel ontModel)
public static String getOntPolicyFilePath(edu.stanford.smi.protege.model.Project project)
public static void setOntPolicyFilePath(edu.stanford.smi.protege.model.Project project, String path)
public static void removePropertyValue(com.hp.hpl.jena.rdf.model.Resource resource, com.hp.hpl.jena.rdf.model.Property property, com.hp.hpl.jena.rdf.model.RDFNode value)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |