sparql - Filter SELECT output by string in Spaql -
i have sparql query :
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix owl: <http://www.w3.org/2002/07/owl#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix xsd: <http://www.w3.org/2001/xmlschema#> prefix hrdata:<http://www.hrdata.com/ontologies/hrdata.owl#> select ?tablename2 ?fieldname ?primarykey1 ?primarykey2 ?tablename1 { ?tablename1 hrdata:hasfield hrdata:effdt. ?fieldname hrdata:relatedfield hrdata:effdt. ?tablename2 hrdata:hasfield ?fieldname. ?primarykey1 hrdata:isprimarykey ?tablename1. ?primarykey2 hrdata:isprimarykey ?tablename2. }
it returns long list of different tablenames me, because have same property name 'effdt'. want add condition this, tell mean 'effdt' related table name 'xyz':
filter ( ?tablename1 = 'xyz')
i google lot, unfortunately non of solution can in following page me.
http://answers.semanticweb.com/questions/3530/sparql-query-filtering-by-string
do have idea?
?tablename1
in subject position it's uri or blank node.
filter ( ?tablename1 = 'xyz')
tests string.
if mean uri contains string xyz
then:
filter ( contains(str(?tablename1),'xyz'))
Comments
Post a Comment