How to add OWL:imports to a .owl file by jena -
I'm new to Jenna I want to create a new OntModel and want to import some other exchanges for this model. I am If I write it in the file, then I hope the file can look something like this:
& lt; Owl: ottology rdf: about = "" & gt; & Lt; Owl: Import rdf: resource = "http: //test.owl#" /> & Lt; / Owls: Ontology & gt;
Right now, I do not know how Jana can import other mechanisms in the model. Can anyone give me some advice?
Thanks
see Jena (
String base = "http: //www.example." Com / ont "; OntModel model = ModelFactory.createOntologyModel (); Ontology ont = model.createOntology (" "); ont.addImport (model.createResource (" http:
Result:
Code> & rdf: RDF xmlns: rdf = "http://www.w3.org/1999/02/22-rdf-sitex-ns #" xmlns: owl = "http://www.w3.org/2002 / 07 / owl # "xmlns: xsd =" http://www.w3.org/2001/XMLSchema# "xmlns: Rdfs =" http://www.w3.org/2000/01/rdf-schema# " Xml: base = "http://www.example.com/ont" & gt; Owl: otology RdF: about = "" & gt; OWL: import rdf: resource = "http: //test.owl# "/> & lt; / Llu: Ontology & gt; & Lt; / rdf: RDF & gt;
Comments
Post a Comment