Consider we have example database and query in sparql:
:book1 dc:title "SPARQL Tutorial" .
:book1 ns:price 42 .
:book2 dc:title "The Semantic Web" .
:book2 ns:price 23 .
SELECT ?title ?price
WHERE { ?x ns:price ?price .
FILTER (?price < 30.5)
?x dc:title ?title . }
The resul would be:
title price
"The Semantic Web" 23
Let's try to reproduce this example in metta. Database will look like this:
(book1 title sprql-tutorial)
(book1 price 42)
(book2 title semantic-web)
(book2 price 23)
The question is: do we have more elegant way to gain the same result than using code below?
!(match &self ($x price $y)
(if (< $y 30.5)
(match &self ($x title $z) ($z $y))
Empty))
The result would be just what we need:
[(semantic-web 23)]
Consider we have example database and query in sparql:
The resul would be:
Let's try to reproduce this example in metta. Database will look like this:
The question is: do we have more elegant way to gain the same result than using code below?
The result would be just what we need:
[(semantic-web 23)]