Project Marmotta has retired. For details please refer to its Attic page.
Apache Marmotta - Platform - LDPath

Apache Marmotta Platform: LDPath

This module provides LDPath support in the Marmotta plaform.

Protocol

LDPath querying is exposed via a simple RESTful protocol, using JSON for describing the results. Programs can be evaluated using either GET or POST with slightly different methods (check the web services documentation for any further details), where the context uri must be always sent as query parameter.

The results’ schema is very simple:

  • Each path of the program generates a property with the same name.
  • The value of the property is an array with the result of the path evaluation. Each results is always componsed by a value with the string representation and a type with its type (uri/bnode/literal); optionally literals could come typed with lang and/or datatype.

Example

Let’s use this very simple program as example, one that lists all the friend of a concrete URI. Using cURL the request will lool like:

curl -X POST --data ' @prefix foaf: <http://xmlns.com/foaf/0.1/> friends=foaf:knows/foaf:name ; ' -H 'Content-Type: text/plain' 'http://localhost:8080/marmotta/ldpath/program?uri=http%3A%2F%2Fwww.wikier.org%2Ffoaf%23wikier'

and should return something like:

{
  "friends" : [
    { "value":"John Breslin", "type":"literal", "lang":"en" },
    { "value":"Richard Cyganiak", "type":"literal", "lang":"en" },
    { "value":"Chris Bizer", "type":"literal", "lang":"en" },
    ...
  ]
}