Triplestore Queries =================== The SPARQL search API for the TextGrid triplestore is publicly available. As the triplstore contains only structural data without any title information, it is possible to query public and nonpublic data. The URLs are: * https://textgridlab.org/1.0/triplestore/textgrid-nonpublic * https://textgridlab.org/1.0/triplestore/textgrid-public Only GET queries are possible. As the triplestore in use is Sesame, the `rdf4j REST API documentation `_ can be consulted. It is possible to specify the data format to be returned with content negotiation, a list of content types is availabe in the `rdf4j documentation `_ Example 1 --------- List all subitems of `"Alice im Wunderland" `_, and return results in JSON. Query:: curl -G https://textgridlab.org/1.0/triplestore/textgrid-public \ --header 'accept: application/json' \ --data-urlencode 'query= PREFIX ore: PREFIX tg: SELECT * WHERE { (ore:aggregates|ore:aggregates/tg:isBaseUriOf)* ?subitem }' Response:: { "head" : { "vars" : [ "subitem" ] }, "results" : { "bindings" : [ { "subitem" : { "type" : "uri", "value" : "textgrid:kv2r.0" } }, { "subitem" : { "type" : "uri", "value" : "textgrid:kv2q.0" } } ] } } Example 2 --------- Construct query, list all properties, request results with format turtle. Query:: curl -G https://dev.textgridlab.org/1.0/triplestore/textgrid-public \ --header 'accept: text/turtle' \ --data-urlencode 'query= PREFIX tg: PREFIX dc: PREFIX dcterms: PREFIX exif: PREFIX ore: CONSTRUCT { ?p } WHERE { SELECT DISTINCT ?p WHERE { ?s ?p ?o } }' Response:: @prefix tg: . @prefix dc: . @prefix dcterms: . @prefix exif: . @prefix ore: . @prefix rdf: . @prefix rdfs: . @prefix sesame: . @prefix owl: . @prefix xsd: . @prefix fn: . tg:superType , rdfs:label , rdf:type , tg:inProject , tg:isBaseUriOf , tg:notInElasticsearch , dc:format , owl:sameAs , tg:hasPid , tg:isDeleted , ore:aggregates , tg:isEditionOf , tg:isNearlyPublished , tg:hasSchema , tg:hasAdaptor , tg:rootElementLocalPart , tg:rootElementNamespace , exif:yResolution , exif:xResolution , exif:height , exif:width , tg:isDerivedFrom , dc:creator , dcterms:license , tg:depiction .