Recently, I'm trying to approach semantic web using Jena to create RDF and make query. Now, I have successfully made a owl based RDF file in Jena. However, when I trying to use different ontologies (such as: cidoc-crm), I do not know how to import those ontologies to Jena. Does anyone know how to import them to Jena? Do I need to create a new ontology model?
相关问题
- How can I optimize a SPARQL query that returns opt
- Calculate the depth of subclass in the OWL ontolog
- MVC2 - Consume RSS feed with RDF and namespace htt
- RDFlib 'on disk' store
- jena.query.ResultSet and jena.query.QuerySolution:
相关文章
- RDF libraries for Scala [closed]
- The difference between blank nodes and variables i
- How to turn a SPARQL/SPIN query/rule into an RDF s
- Triple extraction from a sentance
- Meaning of owl:hasValue?
- boundary for arbitrary property path in SPARQL 1.1
- boundary for arbitrary property path in SPARQL 1.1
- sparql complete tree from subject
Jena's OntModel interface provides a convenient way of working with ontologies (including RDFS ontologies). The following code shows how you can get an OntModel that contains the data of the ontology. In this code, I then create another OntModel with inference support that includes the CIDOC model that I created. With the inferencing model, it is easy to create individuals and see computed types for them, or see subclass relationships derived by the inference model.
Having to obtain the classes using
OntModel.getOntClass(CIDCOCNS+"...")
is a bit clumsy, and it's very easy to make a typo. Jena provides an excellent schemagen tool that takes an ontology and generates a class of constants that represent the classes, properties, and individuals declared in the ontology. For instance, you could useschemagen
to create aCIDOC
class with, e.g., a constantOntClass
object forE5_Event
so that instead ofyou could do