How to use a column of resource_id inside a SPARQL query?

15 views
Skip to first unread message

caiono...@gmail.com

unread,
May 16, 2016, 5:53:18 PM5/16/16
to RapidMiner Linked Open Data Extension
Hi,

i have a dataframe with a column of resource_ids. I would like to do a query foreach resource_id.

For example:
- resource_id:
'http://dbpedia.org/resource/Alligator_(film)'

- query:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX type: <http://dbpedia.org/ontology/film/>
PREFIX dbp: <http://dbpedia.org/property/>

SELECT ?title
WHERE {
<http://dbpedia.org/resource/Alligator_(film)> dbp:title ?title.
}

Thanks in advance!

Petar Ristoski

unread,
May 16, 2016, 6:20:46 PM5/16/16
to RapidMiner Linked Open Data Extension, caiono...@gmail.com
Hi,

For such a query you need to use the "Custom SPARQL Genrator" operator. To reference the value of the "resource_id" column, just use *resource_id* within the query. E.g. in your query just replace <http://dbpedia.org/resource/Alligator_(film)> with *resource_id* and you will get the results for each instance in the resource_id" column.

Regards,
Petar

Reply all
Reply to author
Forward
0 new messages