owl

no inferences with DL queries in OWL - API

浪子不回头ぞ 提交于 2019-12-13 02:57:34
问题 I am trying to write a query Hospitals and hasNameWithWords value "center"^^string This query returns me the instances that has the hospitals that has "center" in its name in Protege 4.2 with FACT++ reasoner as well as Hermit reasoner but when i input the same query in the OWL-API's DL Query Example thats available in the website http://sourceforge.net/p/owlapi/code/ci/aef6981535f07a2d0d44c394b9f4d5415f36025a/tree/contract/src/test/java/org/coode/owlapi/examples/DLQueryExample.java I don't

why this variable is never have a value

僤鯓⒐⒋嵵緔 提交于 2019-12-13 02:57:29
问题 I am checking that if an instance has a value for a specific predicate, bound that value to a specific variable, otherwise, bound that variable to the value 1 of type integer. this is my code select ?boosted where { :r1 a ?x optional { ?item rs:boostedBy ?boostedOptional bind (if(bound(?boostedOptional), ?boostedOptional, "1"^^xsd:integer) as ?boosted) } } the value of ?boosted is always empty, look please why please? Note I think you don't need data to test why my code is not working,

SPARQL limiting the query result by a variable instead of the number of rows

白昼怎懂夜的黑 提交于 2019-12-13 02:12:48
问题 Lets say I have the following data set: :a rdf:type :AClass :a :hasName "a"^^xsd:string :a :hasProperty :xa :a :hasProperty :ya :a :hasProperty :za :b rdf:type :AClass :b :hasName "b"^^xsd:string :b :hasProperty :xb :b :hasProperty :yb :c rdf:type :AClass :c :hasName "c"^^xsd:string :c :hasProperty :xc I want to query the data set to give me back everything of an instance of :AClass , but only for two instances. I know I have to use the LIMIT keyword, and I have tried a lot of queries but

SPARQL query results in Protege does not recognize transitive property

徘徊边缘 提交于 2019-12-13 01:43:27
问题 I have almost the same requirement expresed in this question: Get all nodes in a transitive relation I am using Protege 3.4.8. This is an Owl-Lite project. I have a transitive property "contains", which is defined as an object property of type Node Node has descendants of type A, B and C I have individuals that link to each other through contains property like this: A contains B contains C When I run the following SPARQL query: SELECT ?A ?B WHERE { ?A :contains ?B } I get : A1 B1 B1 C1 Due to

Why has Pellet inferred an inconsistant “Nothing” subclass with infinite “Entailment” justifications?

风流意气都作罢 提交于 2019-12-13 00:54:28
问题 I'm learning OWL 2.0 using Protégé 4.0 and Pellet 2.2, and I'm trying to understand underlying concepts progressively. So, starting with class hierarchies, I made one class "Cat" as a SubClassOf "Things". If I start Pellet, everything works fine, but if I DL query "Cat", I have Directsubclasses "Nothing" and Subclasses "Nothing" appearing in red. What does it mean? Why is it red? Justifications are like : Explanation for: Nothing SubClassOf Cat <Entailment1252345325436>SubClassOf Nothing and

Why filter doesn't work in this context?

孤人 提交于 2019-12-12 20:57:19
问题 This is the query and the result: As you see, I am filtering out the users that are bo:ania , so why do they still appear? However, if I remove the widecard and select just the users ?user , bo:ania doesn't appear I didn't provide a minimum data example because this is a question about how filter and wildcard work, not about a problem in extracting some data from a data set. However, if you need a minimum data, I'm more than happy to provide it. 回答1: ?specificUser is bound to bo:ania by your

Could we use owl:sameAs in an OWL restriction?

邮差的信 提交于 2019-12-12 20:43:04
问题 For example, I have three classes: Flock, Bird, Velocity. I also have two properties: hasMember (the domain is Flock, range is Bird), and hasAttribute (the domain is Bird, and the range is Velocity). Now I want to add a EquivalentClass restriction to Flock class as the definition. Let consider a very simple definition: in a flock, all birds have the same velocity. How to express this in OWL? 回答1: Warning: this answer is in fact incorrect, please look at the comments to see why. To the

How to retrieve elements of OWL enumerated datatype expression?

被刻印的时光 ゝ 提交于 2019-12-12 18:04:58
问题 What SPARQL query should I use to show all values of union of two datatypes? Additionally how can I count the number of values in this union of datatypes? Each datatype was defined with DataOneOf(...) axiom. EDIT: to start with something: what SPARQL query should I use to show all values of the selected datatype? 回答1: In the future, it would be much easier if you can provide minimal data that we can work with. It would also make the question a bit clearer. As I understand it, you've defined

Calculate the depth of subclass in the OWL ontology

删除回忆录丶 提交于 2019-12-12 14:44:10
问题 I'm looking for a SPARQL query that could return the position of specified subclass in the OWL hierarchy. I have studied several examples but the best result I could ever reach is the computation the relative paths between the specified superclass and its subclasses (thanks to Joshua Taylor). Instead of that I need to calculate the "absolute" depth for a given subclass. My ontology contains several top-level classes and every of them is followed with a separate tree of subclasses. Here is

Loading owl file with Jena

寵の児 提交于 2019-12-12 14:19:04
问题 I load several OWL files (RDF/XML serialization) with Jena as OntModel . For some files I get an error when reading them with ontoModel.read() : Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/HttpMessage . I have org.apache.httpcore-sources.jar in the classpath. The file which currently poses problem is: ontologydesignpatterns.org/cp/owl/timeindexedpersonrole.owl I saved it with Protege as RDF/XML, trying with both extensions .owl and .rdf . The code: public static