问题
In some tutorial I'm reading, I see that you can specify the dataset separately from your query, like this:
Dataset field: http://dig.csail.mit.edu/2008/webdav/timbl/foaf.rdf
query:
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name
WHERE {
?person foaf:name ?name .
}
How do I specify the dataset from within the query?
回答1:
Use the FROM
keyword:
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name
FROM <http://dig.csail.mit.edu/2008/webdav/timbl/foaf.rdf>
WHERE {
?person foaf:name ?name .
}
Note: use it after your SELECT statement
来源:https://stackoverflow.com/questions/17774340/specifying-dataset-within-a-sparql-query