name password
OLI-it Text
EN | DE | ES 6:21 PM
Frederic

Nachricht message (192)
Code, Markierung  Code


Angler Filterprofile (8)


TopLab Answer (53)

Journal
 
Stamm (metapher)
6/25/1996
41.40
HyperLink

/280eb06a-17f1-41b8-8a27-258875495d8c/atomkraft_nein_danke.jpg Frederic

Das bin Ich - eine Privatperson wie Ihr/Wir Alle
https://www.oli-it.com
 
message Frederic
6/23/2011
0.01
16332
[*]

HOWTO get only the direct rdf:type with SPARQL

My RDF graph describes a class hierarchy (rdfs:subClassOf) and some instances (rdf:type) of these classes. For a GUI treeview I need all the instances (leaves) and their direct type.

With reasoning I can query for all the instances (leaves) but get all the inferred super classes also. I need just the direct rdf:type. How can I SPARQL it?

A rdf:type rdfs:Class .
B rdfs:subClassOf A .
C rdfs:subClassOf B .
I1 rdf:type B .
I2 rdf:type C .
I3 rdf:type C .

SELECT * WHERE {
?s a A .
?s a ?t .
}

?s ?t
---- -----
I1 B
I2 C
I3 C

but I get also all the inferred statements. That's right but
I want to exclude it from the result:

I1 rdfs:Resource
I1 rdfs:Class
I2 rdfs:Resource
I2 rdfs:Class
I2 B
I3 rdfs:Resource
I3 rdfs:Class
I3 B
Urheber author (1) PostItAngler description (1) PostItAngler recipient (1) PostItTopLab answer (2)
© 1994 - 2026 | copyright | imprint | comments: info@oli-it.com
4.5.9587.38753-production