Provided Queries

This section contains links to pre-written SPARQL queries.

This query starts with listing the prefixes of all the ontologies to be used. The variables that are being returned are the object that we're searching for, in this case Fiennes's father, and the snippet from which this information is derived from. This query also shows the graph that is being searched and specifies the context, which is listed after rdf:type. Outside of the graph section, the query searches for the snippet of text that the data is stored as. The last line is what we're searching for; it allows us to specify the relationship between the subject and the object.

The name of the person whose information is being searched is in bold. In this case, the person is Celia Fiennes. If you would like to search for another person, a name can be chosen from

The other data in bold is the predicate which connects the subject and object. There are a variety of predicated in the CWRC Ontology, any of which may be used to construct a query.

                    PREFIX cwrc: <>
PREFIX rdf: <>
PREFIX rdfs: <>
PREFIX data: <>
PREFIX skos: <>
PREFIX oa: <>

SELECT ?name ?snippet WHERE { 
    GRAPH <> {
        ?context ?pred ?obj;
            cwrc:contextFocus ?person;
            oa:hasTarget ?target;
            rdf:type cwrc:FamilyContext.
        ?person rdfs:label "Fiennes, Celia".
    	?obj rdfs:label ?name.
    ?target oa:hasSelector/oa:refinedBy/oa:exact ?snippet.
    ?pred cwrc:subjectCentricPredicate cwrc:hasFather.

Family & Friends & Intimate Relationships

Who was the father of an author?

Who was the mother of an author?

Who was the brother of an author?

Notice the queries above only differ slightly. They each specify a different person and have a different predicate following the cwrc:subjectCentricPredicate, but are otherwise identical.

The predicate following 'cwrc:' can be replaced with many others which are listed on the CWRC website. Some examples include:

Who were the family members of a particular author?

Who were the siblings of a particular author?


How many authors lived in London?

You will notice something different about the query above. Most of the other queries had the following construction under GRAPH:

                    ?context ?pred ?obj

This query had specified the object instead of leaving it as a variable. The object was taken from the GeoNames ontology. If you would like to specify a different location, search for a place on replace the number in the URI to reflect your desired location.

                    ?context ?pred <>

Where did a particular author travel to?

What places has an author visited?

Did a particular author immigrate anywhere?


How many authors were also teachers?

Notice how the query above returned a small number of people who were also teachers. There were certainly more than 45 teachers, so why was the result so small? This has to do with the specifics of your query. In the data teachers are not only grouped by hasOccupation but also by hasPaidOccupation, hasVolunteerOccupation, etc.

Using hasPaidOccupation and hasVolunteerOccupation alone would look like the following:

How many authors were paid teachers

How many authors were volunteer teachers

So you can see that the hasOccupation predicate can be replaced by others to modify queries. However, all of these predicates are also subproperties of the predicate Occupation. You can search for these subproperties by using the rdfs:subPropertyOf* constraint to return results for every author who was a teacher. The query below is an example of this:

How many authors were also teachers? (Using subproperties)

How many people held each job?

What was the most popular job?


Where did a particular author go to school?

What subjects were studied by a particular author?

What were the schools attended by a particular author?


When did a particular author die?

What was the cause of death of a particular author?

Where did a particular author die?

Where was a particular author buried?


What was a particular person’s political affiliation?

What political organizations was a particular author associated with?


When was a particular author born?

Where was a particular author born?


Associated Via Health With


Associated By Violence With


Relates Economically To

Leisure and society

What hobbies did a person enjoy?