I have owl files with various formats (RDF / XML, Turtle, Manchester OWL Syntax). I want to define a format based on its contents, since the other format has its own style.
eg
RDF / XML:
<?xml version="1.0"?> <!DOCTYPE rdf:RDF [ <!ENTITY owl "http://www.w3.org/2002/07/owl#" > <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >]> <rdf:RDF xmlns="namespace#" xml:base="namespace" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-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#"> <owl:Ontology rdf:about="namespace"/> <owl:ObjectProperty rdf:about="namespace#my1"/> <owl:ObjectProperty rdf:about="namespace#my2"/> <owl:DatatypeProperty rdf:about="namespace#prop1"/> <owl:DatatypeProperty rdf:about="namespace#prop2"/> <owl:Class rdf:about="namespace#A"/> <owl:Class rdf:about="namespace#B"/> <owl:Class rdf:about="namespace#C"/> <owl:Class rdf:about="namespace#P"/> </rdf:RDF>
Manchester OWL Syntax:
Prefix: : <namespace#> Prefix: owl: <http://www.w3.org/2002/07/owl#> Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> Prefix: xml: <http://www.w3.org/XML/1998/namespace> Prefix: xsd: <http://www.w3.org/2001/XMLSchema#> Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#> Ontology: <namespace> ObjectProperty: my2 ObjectProperty: my1 DataProperty: prop2 DataProperty: prop1 Class: B Class: A Class: P Class: C
So, although I have two files with the same name myOntology.owl , I can determine its format based on the above content (just by opening it in an editor). How to do this using the OWL-API in JAVA? Also, how are they distinguished by loading methods from OWLOntologyManager ?
source share