-
Notifications
You must be signed in to change notification settings - Fork 1
Graph API
Lorenzo edited this page Oct 16, 2015
·
4 revisions
to serve partial graphs from the triple store in JSON-LD format.
A. query a node: web resource, keyword, entity using the SPARQL endpoint (/sparql?query=
)
B. return the node object and its neighbouring nodes in JSON-LD
-
endpoint/list
: a list of starting nodes -
endpoint/<id>
: perform A and B
Example of partial graph:
/* Example of JSON representing the graph:
Three nodes:
A. Article
B. keyword
C. semantic entity.
Two edges:
A -> B
C -> B
*/
{
"nodes": [
{
"@id": "/data/webresource/ahJkZXZ-Y2hyb25vc3RyaXBsZXNyGAsSC1dlYlJlc291cmNlGICAgICAxLkKDA",
"schema:url": {
"@type": "schema:URL",
"@value": "http://funcube.org.uk/2015/03/09/solar-eclipse-march-20th-2015/"
},
"@type": "schema:Article",
"schema:headline": {
"@type": "https://schema.org/Text",
"@value": "Solar Eclipse - March 20th 2015"
},
"uuid": 5882524647555072,
"schema:author": {
"@type": "schema:Text",
"@value": "funcube.org.uk"
},
"schema:datePublished": {
"@type": "schema:DateTime",
"@value": "2015-03-09T10:33:06"
},
"schema:about": {
"@type": "schema:Text",
"@value": "We have a total solar eclipse coming up on March 20th which tracks across the North Atlantic and eventually covers a lot of the Arctic. It would seem that this will affect most spacecraft that are in a polar orbit to some extent as, at that sort of time, they would expect to be in sunlight [...]"
}
},
{
"@id": "lunar+eclipses",
"@type": "chronos:keyword",
"chronos:index": "lunar eclipses",
},
{
"@id": "solarsystem:Moon",
"uuid": 0000000000000002,
"@type": [
"astronomy:PlanetaryBody",
"astronomy:Natural_satellite"
],
"astronomy:orbitsPlanet": {
"@id": "solarsystem:Earth"
},
"owl:sameAs": [
{
"@id": "http://live.dbpedia.org/data/Moon.ntriples"
},
{
"@id": "http://sw.opencyc.org/2012/05/10/concept/en/MoonOfEarth"
},
{
"@id": "http://umbel.org/umbel/rc/MoonOfEarth"
}
],
"rdf:label": "Moon"
}
],
"edges": [
{
"source": 5882524647555072,
"destination": "lunar+eclipses",
"type": "chronos:relConcept"
},
{
"source": 0000000000000002,
"destination": "lunar+eclipses",
"type": "chronos:relConcept"
},
]
}