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
SPARQL queries contain triple patterns, much like the data itself, which utilise the relationships to quickly navigate any linked data. This language is common for all linked data so queries can traverse across multiple RDF databases at once. Query 7 in the next section is an example of this powerful characteristic.
So we actually want to be able to match triples if either rdfs:label or skos:altLabel equal the name of the player. I thought there might be a way to write an OR clause within the WHERE block, but as I understand it, the way to achieve this in SPARQL is via a UNION statement.
•SPARQL FILTERs eliminate solutions that do not cause an expression to evaluate to true. •Place FILTERs in a query inline within a basic graph pattern Category Functions / Operators Examples
CONTAINS is a predicate used in the WHERE clause of a Transact-SQL SELECT statement to perform SQL Server full-text search on full-text indexed columns containing character-based data types. CONTAINS can search for:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With