0% found this document useful (0 votes)
4 views6 pages

SPARQL Queries for Data Selection

The document describes 5 SPARQL queries: 1) Returns all subject, predicate, object combinations 2) Returns the first 3 subject, predicate, object combinations 3) Returns subject, predicate, object combinations starting from the 4th row 4) Returns distinct records where the prefLabel contains the exact text "Khuzestan" 5) Returns distinct records where the prefLabel contains the text "Khu"
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

SPARQL Queries for Data Selection

The document describes 5 SPARQL queries: 1) Returns all subject, predicate, object combinations 2) Returns the first 3 subject, predicate, object combinations 3) Returns subject, predicate, object combinations starting from the 4th row 4) Returns distinct records where the prefLabel contains the exact text "Khuzestan" 5) Returns distinct records where the prefLabel contains the text "Khu"
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Query 1: SELECT ?s ?p ?o WHERE { ?s ?p ?o .

}
Description: To select all the subject, predicate and object combinations.

Query 2: SELECT ?s ?p ?o WHERE { ?s ?p ?o . } LIMIT 3


Description: To select first three rows of subject, predicate and object combinations.

Query 3: SELECT ?s ?p ?o WHERE { ?s ?p ?o . } OFFSET 3

Description: To display the subject, predicate and object combinations starting from
fourth row.

Query 4: SELECT DISTINCT ?record ?otherURIs ?prefLabel WHERE { ?record ?


otherURIs ?[Link] (str(?prefLabel)="Khuzestan").}

Description: To select the distinct records which has the prefLabel contains the
exact text Khuzestan .

select ?s ?p ?o where {?s ?p ?[Link](str(?


o)="[Link]

Query 5: SELECT DISTINCT ?record ?otherURIs ?prefLabel WHERE { ?record ?


otherURIs ?[Link] regex(?prefLabel,"Khu").}

Description: To select the distinct records which has the prefLabel contains the text
Khu .

select distinct ?s ?p ?o where {?s ?p ?[Link] regex(?o,"ltr").}

You might also like