|
Summary
Query-TopicMap [-TopicMapAddress] <String> [-Query] <String>
Description
Runs a SPARQL query against a topic map and displays the results.
Parameters
| • | TopicMapAddress <String>
The web address of the topic map to be queried. This is a positional parameter - it must appear as the first parameter in the command and the parameter name may be omitted. |
| • | Query <String>
The SPARQL query to be executed. This is a positional parameter - it must appear as the second parameter in the command and the parameter name may be omitted. |
Returns
A list of PowerShell objects (PSObject) instances, where each object has one property for each column in the results table.
Examples
When entering a query on the command-line you may find it easier to use an intermediate variable to hold the query string as shown in the following example. Note that PowerShell handles multi-line strings quite nicely - after closing all curly braces and the quotes around the string, just press return at the >> prompt to terminate the multi-line edit mode.
PS C:\Users\Administrator> $q="
>> PREFIX tms: <http://www.networkedplanet.com/tmsparql/>
>> SELECT ?p ?l WHERE {
>> ?p a <http://www.networkedplanet.com/ontology/employment/person> .
>> ?p tms:label ?l
>> }"
>>
PS C:\Users\Administrator> Query-TopicMap http://localhost/web3/topicmaps/d51bb6e4-3ae9-4db0-917f-bd1ea20fb396 $q
p l
- -
http://localhost/web3/topicmaps/d51bb6e4-3ae9-4db0-917f-... Bert
http://localhost/web3/topicmaps/d51bb6e4-3ae9-4db0-917f-... Alf
|