I am loading a N-triple(.nt)
file in Fuseki
and then using SPARQL
query to query the data. The N-triple
file I am using is - linkedct-dump-2010-02-10.zip
at this link.
When I view the same file in Protege ontology editor
(link here) I see following:
As can be seen there are Classes
within Entities
. I am currently working with trials
class. When I click on any of the Instances
of trials
class I see following:
So it can be seen that there are Classes
within the data and each class
has instances
. Now when in Fuseki
I try to get all the classes through following SPARQL query:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?type
WHERE {
?s a ?type.
}
The output I see is just a list of urls
something like this:
How do I get the Classes
within the data and then get instances
within a specific class(in my case trials
class) and then select any Individual Annotations
(in pic 2 you can see individual annotation for a specific instance in trials class as viewed in protege editor) within a specific instance?
Update: Following is a sample data i see when I open the .nt file in wordpad:
<http://data.linkedct.org/resource/trials/NCT00000102> <http://data.linkedct.org/resource/linkedct/condition> <http://data.linkedct.org/resource/condition/3196> .
<http://data.linkedct.org/resource/trials/NCT00000104> <http://data.linkedct.org/resource/linkedct/condition> <http://data.linkedct.org/resource/condition/7149> .
<http://data.linkedct.org/resource/trials/NCT00000105> <http://data.linkedct.org/resource/linkedct/condition> <http://data.linkedct.org/resource/condition/2080> .
rdf:type owl:Class` that's why Joshua's query doesn't work here. So you can only use your initial query to get all classes.– UninformedUser Aug 09 '17 at 06:01?p ?o .`, and if you want to have just a particular property `p`, indeed replace the `?p` by the URI, i.e. `?o .` Hope this helps.