...
To get an idea of how it works, try the following iTQL query, which asks for information about all Service Definition objects in the repository:
Code Block |
---|
| sql | sql |
---|
borderStyle | solid |
---|
| sql |
---|
|
select $object $modified from <#ri>
where $object <fedora-model:hasModel> <info:fedora/fedora-system:ServiceDefinition-3.0>
and $object <fedora-view:lastModifiedDate> $modified
|
...
In this example, we'll show how to extract a subgraph from the resource index using iTQL. Enter the following query text:
Code Block |
---|
| sql | sql |
---|
borderStyle | solid |
---|
| sql |
---|
|
select $a $r $b from <#ri>
where $a <fedora-model:hasModel> <info:fedora/fedora-system:FedoraObject-3.0>
and $a $r $b
and $b <fedora-model:hasModel> <info:fedora/fedora-system:FedoraObject-3.0>
|
...
As with the user interface, it can be invoked to retrieve tuples or triples. The syntax is described below.
Note:
...
- Square brackets ( "\[" and "\]" ) indicate that the parameter is optional.
- As with all HTTP parameters, unsafe URI characters should be URI-escaped. For readability purposes, URI escaping is not shown below.
- The query and template parameters optionally take the value by reference – that is, a URL to a query or template can be given instead of the actual text.
- The flush parameter tells the resource index to ensure that any recently-added/modified/deleted triples are flushed to the triplestore before executing the query. This option can be desirable in certain scenarios, but for performance reasons, should be used sparingly when a process is making many API-M calls to Fedora in a short period of time: We have found that Mulgara generally achieves a much better overall update rate with large batches of triples.
Syntax for Requesting Tuples
Code Block |
---|
| html | html |
---|
borderStyle | solid |
---|
| html |
---|
|
http://localhost:8080/fedora/risearch?type=tuples
&flush=[*true* (default is false)]
&lang=*itql|sparql*
&format=*CSV|Simple|Sparql|TSV*
&limit=[*1* (default is no limit)]
&distinct=[*on* (default is off)]
&stream=[*on* (default is off)]
&query=*QUERY_TEXT_OR_URL*
|
Syntax for Requesting Triples
Code Block |
---|
| html | html |
---|
borderStyle | solid |
---|
| html |
---|
|
http://localhost:8080/fedora/risearch?type=triples
&flush=[*true* (default is false)]
&lang=*spo|itql|sparql*
&format=*N-Triples|Notation 3|RDF/XML|Turtle*
&limit=[*1* or more (default is no limit)]
&distinct=[*on* (default is off)]
&stream=[*on* (default is off)]
&query=*QUERY_TEXT_OR_URL*
&template=[*TEMPLATE_TEXT_OR_URL* (if applicable)]
|