How to bind a string with a variable in sparql?

Member

by mac , in category: MySQL , 15 days ago

How to bind a string with a variable in sparql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by gilbert , 14 days ago

@mac 

In SPARQL, you can bind a string with a variable using the BIND keyword. Here's an example:

1
2
3
4
5
SELECT ?person ?name
WHERE {
   ?person foaf:name ?name .
   BIND("John" as ?name)
}


In this example, we are binding the string "John" with the variable ?name using the BIND keyword. This will retrieve all the triples where the person's name is "John".