Menu
  • HOME
  • TAGS

Getting started with OWL API

java,owl,owl-api

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...

Edit an OWL Individual using OWL API

ontology,owl-api

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...

How to properly merge 2 ontologies with OWL API 4 or 3.5

java,merge,ontology,owl-api

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...

Cannot Get Annotations for OWLClass in OWLAPI

java,owl,owl-api

Yes, this has changed in OWLAPI 4. Use EntitySearcher.getAnnotations(cls.getIRI(), ontology) instead.

Make SWRL request using OWL API

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...

Add my defined anntation to an individual in owl

semantics,owl,owl-api

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)); ...

How to check if OWLObjectPropertyExpression between classes exists?

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...

Does the OWL API Support Oasis XML Catalogs?

java,owl-api

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...

Retrieve owl:restrictions using the OWL API

java,api,owl,protege,owl-api

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...

Print subclasses of all defined classes without printing the unsatisfied classes

java,owl,ontology,owl-api

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....

How to disinguish between inferred and explicit axiom?

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...

Convert OWL/XML in RDF/XML with a simple command line in shell

java,shell,rdf,owl,owl-api

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...

OWL-API 4.0.1 compatiable pellet reasoner?

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...

Retrieve OWL Individuals with same Object Properties using OWL API 4.0

java,owl,protege,owl-api

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...

Delete ontology individuals with OWL API not deleted in Protege

eclipse,protege,owl-api

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....

How to reason or make inferences using hermit reasoner in command line

semantic-web,owl,owl-api

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...

semantic search using sparql-dl and owlapi

jsp,search,owl,owl-api

Thank you so much for the help given. adding the necessary dependencies for sparql-dl api did the trick.

Loading owl file in android

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...

owlapi how to add a OWLDatatype to OWLClass

owl-api

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...