Comments (7)
I don't know what you guys are trying to achieve, but neither
?onClass owl:Class 'x'
nor
?onClass owl:Class ?x
are useful triple patterns in SPARQL and won't match any RDF data. owl:Class
is never used as predicate and I guess you mean something different.
Please understand that an individual is assigned to a class by rdf:type
relation.
If I assume that you want to find the classes of a given individual, the query should look like
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?cls WHERE {
<THE_URI_OF_THE_INDIVIDUAL> rdf:type ?cls
}
from openllet.
Thx for your example.
The problem is in .as(Individual.class)
, because sparql answer of sparql don't have OWL type, you can directly cast an Resource (an answer) into an Individual.
Looking at the query there is no way to tell if 'x' is an Individual, Property, or Class.
Imagine a different ontology, you could have more than one result, first could be an Individual and second an Property.
So to get the classes of the Resource 'x' you may need another query in the form :
?onClass owl:Class 'x'
The openllet-query artifact, don't have dependency on Jena. So It will never be able to convert Resource into Individual for you.
from openllet.
Thanks a lot.
I've written another query as you told:
SELECT ?onClass
WHERE { ?onClass owl:Class ?x}
It is invoked with the first QuerySolution. Sadly it returns an empty set and the following warning:
openllet.jena.graph.query.GraphQueryHandler findTriple No query handler found for * http://www.w3.org/2002/07/owl#Class http://www8.cs.fau.de/research:cgm/schizophrenia#R_AcuteSchizophrenia
Any idea what I'm still missing?
from openllet.
Thanks a lot @LorenzBuehmann . This does it for me.
from openllet.
Dave Reynolds suggests on the Dashboard that
[...] SparqlDLExecutionFactory is returning resources that aren't in the expected model [...]
His workaround does it for me either:
Individual in = qs.getResource("x").inModel(m).as(Individual.class);
So I'm not sure if it is a bug or desired behavior. Let me know and I close the issue.
from openllet.
After doing some tracing in the code, I found where the model change.
I belive, the model change because the result is build from the KB not from the original model.
The result could can contains resources that aren't part of the original model but are created by reasoning : like "Inv(property)".
I am not sure of the expected behaviour.
By the way none of the examples using Sparql(neither in pellet-2.3.6-ansell) are working, so I have to repairs them before tagging this as a bug or a feature.
from openllet.
I just commit a correction for the sparql example.
Dave Reynolds say the issue is in Openllet... he's opinion.
All the classes involve in the construction of the Resource are from Jena.
The logical chain is the following :
Dataset dataset = DatasetFactory.create(modelFromUser);
//Here reasoning on the dataset take place.
Model model = dataset.getDefaultModel();
new org.apache.jena.sparql.core.ResultBinding(model, binding); // this is the result.
This look clear to me, I see no reason to change it; issue is in Jena way to interact with world.
from openllet.
Related Issues (20)
- Inconsistent results for EL and DL ontologies. HOT 2
- Clearify the relation to Pellet HOT 3
- Build Error (maven on debian10) HOT 2
- ArrayIndexOutOfBoundsException when using minQualifiedCardinality
- class file has wrong version 54.0, should be 52.0 HOT 2
- getInstances for Class Expressions using Complement doesn't work correctly HOT 2
- invalid explanations with owlapi HOT 3
- Reasoner `.bindSchema` doesn't work HOT 1
- USE_UNIQUE_NAME_ASSUMPTION = true leads to contradictions HOT 1
- DL query is NULL for Openllet reasoner
- Openllet-Jena 2.6.5 is conflicting with Apache Jena Libs > 3.15.0 ( java.lang.NoSuchFieldError: SHACLC) HOT 2
- Unsupported rule Rule HOT 2
- replace travis-ci.org with different ci service HOT 2
- The command line interface shound be documented
- [ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:4.1.0:bundle HOT 1
- Broken Logging
- Jena API Performance Problems HOT 2
- Wrong DisjointClass(A,B) inferred if the ontology includes a Subclass(A, ObjectComplementOf(B)) HOT 2
- Do not work in Protege5.1.0 HOT 2
- Contribute Eclipse plugin bundling HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openllet.