conjecto/easyspinrdf

SPIN implementation using the awsome EasyRdf

0.1.0-beta.1 2013-03-11 14:42 UTC

This package is not auto-updated.

Last update: 2024-12-21 15:44:36 UTC


README

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.

Build Status

Example

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) .
}

Links

Todo