You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2015/04/27 10:30:52 UTC
svn commit: r1676218 -
/marmotta/site/trunk/content/markdown/platform/ldpath-module.md.vm
Author: wikier
Date: Mon Apr 27 08:30:52 2015
New Revision: 1676218
URL: http://svn.apache.org/r1676218
Log:
added more ldpath documentation for the platform module
Modified:
marmotta/site/trunk/content/markdown/platform/ldpath-module.md.vm
Modified: marmotta/site/trunk/content/markdown/platform/ldpath-module.md.vm
URL: http://svn.apache.org/viewvc/marmotta/site/trunk/content/markdown/platform/ldpath-module.md.vm?rev=1676218&r1=1676217&r2=1676218&view=diff
==============================================================================
--- marmotta/site/trunk/content/markdown/platform/ldpath-module.md.vm (original)
+++ marmotta/site/trunk/content/markdown/platform/ldpath-module.md.vm Mon Apr 27 08:30:52 2015
@@ -3,3 +3,38 @@
# Apache Marmotta Platform: LDPath
This module provides [LDPath](../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 servcices 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 ; ' 'http://localhost:8080/marmotta/ldpath/program?uri=http%3A%2F%2Fwww.wikier.org%2Ffoaf%23wikier' -H 'Content-Type: text/plain'
+
+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" },
+ ...
+ ]
+ }
+