SPIN SPARQL Syntax implementation using the awesome EasyRdf.
SPIN SPARQL Syntax is a machine-readable notation of SPARQL in RDF format. This EasyRdf extension convert SPIN RDF data structures into valid SPARQL query strings.
Take this RDF graph in ttl :
my:query
a sp:Ask ;
sp:where (
[ sp:object sp:_age ;
sp:predicate my:age ;
sp:subject spin:_this
] [ a sp:Filter ;
sp:expression
[ sp:arg1 sp:_age ;
sp:arg2 18 ;
a sp:lt
]
] )
]
Get the corresponding SPARQL Query with EasyRdf and EasySpinRdf :
EasySpinRdf_Utils::setTypeMappers();
$graph = new EasyRdf_Graph("http://conjecto.com/queries.ttl");
$graph->load();
echo $graph->get("my:query")->getSparql();
Result :
ASK WHERE {
?this my:age ?age .
FILTER (?age < 18) .
}
- EasyRdf Homepage
- Source Code: http://github.com/njh/easyspinrdf
- Issue Tracker: http://github.com/njh/easyspinrdf/issues
- Conjecto Homepage
- Reverse engineering
- SPIN Modeling Vocabulary support