SPARQL Query Example 1 in web ontology

Resource description freamework(RDF):

learning sparql

SPARQL Query:

PREFIX ab: <https://www.t4tutorials.com/personal#>
SELECT ?name
WHERE
{
?person ab:firstName “barak” .
?person ab:lastName “obama” .
?p
  • ?name is a variable any name can be in this variable
  • ?person is the subject and
  • firstName is the predicate
  • lastName is the predicate
  • barak is the object
  • obama is the object

Output:

name
barak obama