Are you compiling the OWL API source? You can skip having to fill in all dependencies manually in two ways: import existing maven project in Eclipse (this will use the pom files to determined dependencies) look at the classpath files in the antbuild folder and make sure your .classpath file...
Use the full IRI instead of a shortened version, it is hard to tell from this code whether the namespace is the correct one (":test" is ambiguous, since we cannot see how the prefix manager resolves it, and we cannot see the ontology). Also, make sure to save the ontology...
The namespace for the ontologies is not the issue - the problem is when the ontologies have the same ontology id. In that case, they cannot be merged in the same manager - the manager needs the relation ontologyID->ontology to be functional. To be able to use the same ontology...
Yes, this has changed in OWLAPI 4. Use EntitySearcher.getAnnotations(cls.getIRI(), ontology) instead.
java,owl,ontology,owl-api,swrl
In general, if you don't have an assertion that some individual x belongs to a certain class, then you'll need a reasoner to infer that for you (provided that it follows from some other data that you do have). This applies whether the inference is based on OWL axioms or...
In order to use any annotation property you wish to use, the snippet above must be modified this way: OWLAnnotation Movie_Name = factory.getOWLAnnotation( factory.getOWLAnnotationProperty(IRI.create("full iri for your property here")), lbl); OWLAxiom axiomAA = factory.getOWLAnnotationAssertionAxiom(Cast.asOWLNamedIndividual().getIRI(), label); manager.applyChange(new AddAxiom(ontology, axiom)); ...
rdf,semantic-web,owl,owl-api,reasoning
I can suggest two solutions to your problem: Go through all Bs, but instead check satisfiability of A and (isManagedBy only (not B)). If this expression is unsatisfiable for some B, then such B has to be connected with a given A via isManagedBy. If you are using FaCT++ for...
The Protege team have released the xmlcatalog component as a standalone (from the rest of Protege) module and it has an implementation of OWLOntologyIRIMapper: https://github.com/protegeproject/xmlcatalog/blob/master/src/main/java/org/protege/xmlcatalog/owlapi/XMLCatalogIRIMapper.java...
I am not sure what exactly you mean by "steps", but I think you have a class and you need all the restrictions that applies to subclasses. However, what will happen if you also want restrictions applied to equivalent classes? Therefore, I thought to write a more general one. Here...
Replace if (subClass.isBottomEntity()|| subClass.equals(array[0])|| subClass.equals(array[1])|| subClass.equals(array[2])){ with if (subClass.isBottomEntity()|| unsatisfiable.contains(subclass)) { which has the same effect. There's no need for you to copy the unsatisfiable set out to an array....
java,ontology,owl-api,reasoning,inferred-type
Asserted axioms differ from inferred only because they are explicitly present in the ontology. You can check if an axiom is present in an ontology this way: OWLOntology o = ... OWLAxiom ax = ... boolean asserted = o.containsAxiom(ax); Note: if an axiom has annotations, it is possible that it...
To change a entire repository of an OWL/XML file into RDF/XML file: 1- create your package owl2rdf.java package owl2rdf; //import all necessary classes import java.io.File; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.io.RDFXMLOntologyFormat; import org.semanticweb.owlapi.model.IRI; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLOntologyManager; @SuppressWarnings("deprecation") public class owl2rdf { #create a main() function to take an argument; here in...
jena,semantic-web,owl-api,pellet
There isn't a Pellet version compatible with OWLAPI 4 yet - I'm planning to release one at the end of this week. Keep an eye on https://github.com/ignazio1977/pellet for updates. Currently, the latest versions of FaCT++ (1.6.3) and JFact (4.0.0) are compatible with OWLAPI 4.0.1. I am not aware of the...
Here is the simplest way I could think of. It involves reasoning with nominals, so it might be computationally expensive. However, if the ontology is not too big, this approach is feasible. The idea is to get all the instances of every Gaurdian. Then for every such individual get all...
Have you saved the ontology afterwards? You need to call manager.saveOntology(localPicture); after applying the changes or they are only effective for the in memory copy of the ontology....
I don't think HermiT offers a command line interface, but you can try this example from Owl api which allows simple queries on the command line https://github.com/owlcs/owlapi/wiki/DL-Queries-with-a-real-reasoner...
Thank you so much for the help given. adding the necessary dependencies for sparql-dl api did the trick.
java,android,semantic-web,owl,owl-api
Tackling Build path error: Normally if you are using owl api in java then all you need is just to import the owl api library. But in android if you do only this you will still get error stating "method not found". So you need to perform a second step...
Something like this might help: OWLDatatype datatype = factory.getOWLDatatype("xsd:string",pm); OWLLiteral lit= factory.getOWLLiteral("1", datatype); Maybe you want to define min and max restriction: OWLDataUnionOf union = factory.getOWLDataUnionOf( factory.getOWLDatatypeMinInclusiveRestriction(1), factory.getOWLDatatypeMaxInclusiveRestriction(10)); OWLDatatypeDefinitionAxiom axiom = factory.getOWLDatatypeDefinitionAxiom(datatype, union); Edit #1: I have added new code based on the edited question. PrefixManager pm= new...