We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
I have the following simple code:
OWLOntologyManager ontologyManager = OWLManager.createOWLOntologyManager(); OWLDataFactory dataFactory = ontologyManager.getOWLDataFactory(); OWLOntology ontology = ontologyManager.createOntology(IRI.create(PREFIX)); OWLClass owlClass1 = dataFactory.getOWLClass(IRI.create(PREFIX + "C1")); OWLClass owlClass2 = dataFactory.getOWLClass(IRI.create(PREFIX2 + "C2")); ontology.addAxiom(dataFactory.getOWLDeclarationAxiom(owlClass1)); ontology.addAxiom(dataFactory.getOWLDeclarationAxiom(owlClass2)); RDFXMLDocumentFormat format = new RDFXMLDocumentFormat(); format.setPrefix("o2:", PREFIX2); ontologyManager.saveOntology(ontology, format, IRI.create("file:/some/path"));
The saved ontology looks like this (I've removed comments):
<?xml version="1.0"?> <rdf:RDF xmlns="http://example.com/ontology1/" xml:base="http://example.com/ontology1/" xmlns:o2="http://example.com/ontology2/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <owl:Ontology rdf:about="http://example.com/ontology1/"/> <owl:Class rdf:about="http://example.com/ontology1/C1"/> <owl:Class rdf:about="http://example.com/ontology2/C2"/> </rdf:RDF>
My goal here is to force OWL-API to use shortened IRIs inside the rdf:about property. I.e. to have something like this:
rdf:about
<owl:Class rdf:about="&o2;C2"/>
The text was updated successfully, but these errors were encountered:
format.setPrefix("o2:", PREFIX2);
The semicolon shouldn't be there in the prefix name, try
format.setPrefix("o2", PREFIX2);
Sorry, something went wrong.
No branches or pull requests
Hi!
I have the following simple code:
The saved ontology looks like this (I've removed comments):
My goal here is to force OWL-API to use shortened IRIs inside the
rdf:about
property. I.e. to have something like this:The text was updated successfully, but these errors were encountered: