Vocabularies behind the datasets hosted on Talis

5 views
Skip to first unread message

Monika Solanki

unread,
Jun 21, 2010, 5:16:27 AM6/21/10
to n2-dev
Hello,

I am looking for a way to find out the vocabularies used behind any
specific dataset hosted on Talis. For example if I wanted to run a
sparql query over the govuk-education dataset, I would need to know
the vocabularies. Please could someone point me to the right docs/
tutorials etc for this.

Thanks,

Monika

Dan Brickley

unread,
Jun 21, 2010, 5:30:08 AM6/21/10
to n2-...@googlegroups.com

It might not be the ideal solution, but you can explore the basics using SPARQL.

eg. something like

SELECT DISTINCT ?prop WHERE {
?x ?prop ?val .
}

In http://services.data.gov.uk/education/sparql I get a nice list of
properties. Well, OK not *nice*, it is raw SPARQL result format, but
the basic information is there.

To find classes, you'd ask

SELECT DISTINCT ?class WHERE {
?x a ?class .
}

To find which properties and classes go together, .... hmm that
depends on whether the store also includes the relevant schema. Let's
see.

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?class ?prop WHERE {
?x a ?class .
?prop rdfs:range ?class .
}

Ok that seems to do something useful. It finds things that are
instances of some class, and then finds properties whose "range" (ie.
expected values) are members of that class.

Changing the rdfs:range to rdfs:domain, we get

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?class ?prop WHERE {
?x a ?class .
?prop rdfs:domain ?class .
}

...which finds properties whose "domain" is those classes, ie. the
kinds of entity the property is used with.

Note that this is very raw data and doesn't involve reasoning about
any complex hierarchies. But it should give you an idea what's going
on in there...

Hope this helps!

Dan

Reply all
Reply to author
Forward
0 new messages