SPARQL query for partial match of statement (contains)

12,822

I have an object containing "blablablaUsefulblablabla"

If I understand you correctly, it sounds like you want the contains function. E.g., on DBpedia:

select distinct ?city ?label where {
  ?city a dbpedia-owl:City ;
        rdfs:label ?label .
  filter contains(?label,"San")         #-- the important line
  filter langMatches(lang(?label),'en')
}
limit 100

SPARQL results

Share:
12,822
RobinAugy
Author by

RobinAugy

Updated on July 24, 2022

Comments

  • RobinAugy
    RobinAugy almost 2 years

    I would like to know if there is a way in SPARQL to query for partial matches of statements. So if for example in the triple store I have an object containing "blablablaUsefulblablabla" I would like to be able to query for Useful, so I want to say that the statement "Useful" should be found, independent of what is before or after this statement.

    Is there a way to do this?

    Thanks