Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SPARQL for British Museum Satires with titles and dates
PREFIX crm: <http://erlangen-crm.org/current/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX thes: <http://collection.britishmuseum.org/id/thesauri/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bmo: <http://collection.britishmuseum.org/id/ontology/>
PREFIX thesIdentifier: <http://collection.britishmuseum.org/id/>
SELECT DISTINCT ?id ?title ?name ?desc ?date
{
?object crm:P70i_is_documented_in <http://collection.britishmuseum.org/id/bibliography/294> .
OPTIONAL {
?object crm:P48_has_preferred_identifier ?id }.
OPTIONAL {
?object bmo:PX_physical_description ?desc } .
OPTIONAL {
?object crm:P108i_was_produced_by ?prodevent.
?prodevent crm:P9_consists_of ?prodpart .
?prodpart crm:P4_has_time-span ?timespan.
?timespan rdfs:label ?date} .
OPTIONAL {
?object crm:P108i_was_produced_by ?prodevent2.
?prodevent2 crm:P9_consists_of ?prodpart2 .
?prodpart2 crm:P14_carried_out_by ?creator.
?creator skos:prefLabel ?name .
?creator skos:inScheme thesIdentifier:person-institution}
OPTIONAL {
?object rdfs:label ?title }
}
@ostephens

This comment has been minimized.

@ostephens

This comment has been minimized.

Copy link
Owner Author

@ostephens ostephens commented Nov 20, 2014

Used the object rdfs:label for the 'title' for convenience. There is a crm:P102_has_title predicate, but this can result in multiple titles for the same object leading to duplication

@ostephens

This comment has been minimized.

Copy link
Owner Author

@ostephens ostephens commented Nov 20, 2014

The 'creator' clause

OPTIONAL {
            ?object crm:P108i_was_produced_by ?prodevent2.
            ?prodevent2 crm:P9_consists_of ?prodpart2 .
            ?prodpart2 crm:P14_carried_out_by ?creator.
            ?creator skos:prefLabel ?name .
            ?creator skos:inScheme thesIdentifier:person-institution}

is problematic as this identifies people/institutions involved in the production but does not specify or retrieve their role. This means you end up with duplication in the final result (for items where multiple agents involved in creation - e.g. a printer and publisher) and you don't get information about the role of each agent in the creation process

@ostephens

This comment has been minimized.

Copy link
Owner Author

@ostephens ostephens commented Nov 20, 2014

Multiple descriptions can also be present - once again resulting in duplication. Must be a better way of dealing with this?

@ostephens

This comment has been minimized.

Copy link
Owner Author

@ostephens ostephens commented Nov 20, 2014

Using the rdfs:label from the timespan results in a simple 'date' statement which can contain a single year, a year range, or a more general statement like "18thC(mid)". You could query for specific fields from the timespan to get more detailed date information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.