I've successfully set up a SPARQL View based on the DBpedia page for a person entity Salman Rushdie
http://dbpedia.org/page/Salman_Rushdie

I'm able to pull in all the items from the dcterms:subject field, but I can't find a way to set up a filter so that, for example, I just get one item containing a keyword. Here's the query as it appears in Preview:

PREFIX dc:
PREFIX rdfs:
SELECT ?dbpedia_description ?dbpedia_description_field_subject
WHERE {
?dbpedia_description dc:subject ?var838391894; rdfs:label "Salman Rushdie"@en; dc:subject ?dbpedia_description_field_subject.
FILTER regex(?var838391894, "faculty")
}

Comments

Anonymous’s picture

It's not clear from that query what you are trying to do. If you only want to show one item, you can specify how many results to return in the pager, "Display a specified number of items"

saslib’s picture

Sorry I didn't write this up more clearly. My problem is that I want to pull just "category:Emory_University_faculty" out of the list of objects for the dcterms:subject (see a selection of the list below). I could count line numbers and ask for the corresponding number of results as you suggest. I would prefer to find a way, if it exists, to filter by keyword so I could pull just that one line, so I wouldn't have to worry about changes in line counts with updates on this record, and so I could use the same filter for other person entities.

category:Alumni_of_King's_College,_Cambridge
category:Islam-related_controversies
category:Fellows_of_the_Royal_Society_of_Literature
category:British_novelists
category:Magic_realism_writers
category:Fatwas
category:British_humanists
category:Copywriters
category:Patrons_of_Ralston_College
category:1947_births
category:Living_people
category:People_from_Mumbai
category:Criticism_of_Islam
category:Emory_University_faculty
category:Booker_Prize_winners
category:Old_Rugbeians
category:British_people_of_Indian_descent
category:Opposition_to_Islam_in_Asia

Thanks for any feedback,
Tim

Anonymous’s picture

It sounds like you want to run a regex on the characters in a URI and then return all the URIs that match as fields. There isn't support for this in SV.

saslib’s picture

Ok thanks.

Anonymous’s picture

Status: Active » Closed (won't fix)