Skip to content

conjecto/easyspinrdf

Repository files navigation

EasySpinRdf

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

About

SPIN implementation using the awsome EasyRdf

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages