I want to retrieve all properties from yago which is an RDFS knowledge base(.nt format).I tried with bellow query
SELECT distinct ?x WHERE { ?y ?x ?z . }
This gives me all the predicates.
In the web they defined predicates as predicates(properties). According to this my result should be correct. But my professor suggested me bellow query
SELECT distinct ?x WHERE { ?y ?x ?z . ?z a ?zt. }
He didn't explain the reason. The results are a little bit different for this 2 query. The result of the 2nd query is a subset of 1st query. Does it mean more precise?
Can anyone help me understand why he added ?z a ?zt .? Will the object used to obtain properties always be rdf:type of a different class?


According to the RDF 1.1 specification:
According to these definitions, you can get all properties in SPARQL with your first request:
The second request is more specific:
It lists all properties used at least once in a triple where the object is also involved in a
rdf:typetriple as a subject.Note that in SPARQL
ais a shortcut forrdf:type.