Stanbol Home

The RESTful Semantic Engine

Entityhub Site Manager

Service Endpoint /entityhub/sites

List of subresources:


Subresource /referenced

Description This service returns a json array containing the IDs of all referenced sites. Sites returned by this Method can be accessed via the SITE service endpoint.
Request GET /entityhub/sites/referenced
Parameter none
Produces application/json

Example

curl "https://enrich.acdh.oeaw.ac.at/entityhub/sites/referenced"

Example response

["http:\/\/localhost:8080\/entityhub\/site\/dbpedia\/",
"http:\/\/localhost:8080\/entityhub\/site\/musicbrainz\/"]

Test

You can check the referenced sites in this installation by clicking here.


Subresource /entity?id={URI}

Description This service searches all referenced sites for the entity with the parsed URI and returns the result in the requested entity in the media type. If the requested entity can not be found a 404 is returned.
Request GET /entityhub/sites/entity?id={URI}
Parameter id: the URI of the requested Entity
Produces Depends on requested media type

Example

curl "https://enrich.acdh.oeaw.ac.at/entityhub/sites/entity?id=http://dbpedia.org/resource/Paris"
Test
Search for entity 'Paris' in DBPedia.

Subresource /find?name={name}

Description This service can be used to search all referenced sites for entities with the parsed name. Both a POST and a GET version are available.
Requests
  • GET /entityhub/sites/find?name={query}&field={field}&lang={lang}&limit={limit}&offset={offset}
  • POST -d "name={query}&field={field}&lang={lang}&limit={limit}&offset={offset}" /entityhub/sites/find
Parameters
  • name: the name of the entity (supports wildcards e.g. "Frankf*")
  • field: the name of the field used for the query. One MUST parse the full name. Namespace prefixes are not supported yet. (default is rdfs:label)
  • lang: optionally the language of the parsed name can be defined
  • limit: optionally the maximum number of results
  • offset: optionally the offset of first result
  • ldpath: The LDPath program executed for entities selected by the find query (optionally). The LDPath program needs to be URLEncoded.
Produces Depends on requested media type

Example

curl -X POST -d "name=Bishofsh*&limit=10&offset=0" https://enrich.acdh.oeaw.ac.at/entityhub/sites/find

Test

Find entities with
Name: (required)
This supports Wildcards such as 'Exam?le*'
Language: (optional, default: any)
Field: (optional, reasonable default - usually rdfs:label)
Limit: (optional, number, default: 10) The maximum number of results
Offset: (optional, number, default: 0) The offset of the first returned result
LDPath:
(optional). LDPath programs can be used to specify what information to return for Entities selected by the /find request. This example selects the english labels, comments, categories, homepage and builds a string representing the location '[{latitude},{longitude}]'.
Output Format: (Accept header set to the request)


Subresource /query

Description Allows to parse JSON serialized field queries to the sites endpoint.
Request -X POST -H "Content-Type:application/json" --data "@fieldQuery.json" /entityhub/sites/query
Parameter query: the JSON serialised FieldQuery (see section "FieldQuery JSON format" below)
Produces The results of the query serialised in the format as specified by the Accept header

Example

curl -X POST -H "Content-Type:application/json" --data "@fieldQuery.json" https://enrich.acdh.oeaw.ac.at/entityhub/sites/query

Note: "@fieldQuery.json" links to a local file that contains the parsed Fieldquery (see ection "FieldQuery JSON format" for examples).


Subresource LDPath (/ldpath?ldpath={ldpath}&context={context})

Description This service can be used to execute an LDPath program on one or more Entities (contexts). Both a POST and a GET version are available.
Request
  • GET /entityhub/ldpath?ldpath=ldpath&context={context1}[&context={contextn}]
  • POST -d "ldpath=ldpath&context={context1}[&context={contextn}]" /entityhub/ldpath
Parameter
  • ldpath: The LDPath program to execute.
  • context: The id of the entity used as context for the execution of the LDPath program. This parameter can occur multiple times
Produces: Produces an RDF Graph with the parsed context(s) as subject the field selected by the LDPath program as properties and the selected values as object. All RDF serialisations are supported however JSON-LD seams to be a natural fit for the data created by LDPath. JSON-LD is also the default encoding.

Example

The following LDPath statement will be executed on the defined contexts

curl -X POST -d "context=http://dbpedia.org/resource/Paris&ldpath=name%20%3D%20rdfs%3Alabel%5B%40en%5D%3B" https://enrich.acdh.oeaw.ac.at/entityhub/sites/ldpath

NOTE: the LDPath MUST BE URLEncoded. The decoded string of the above example is "name = rdfs:label[@en];" and would select the english label of Paris in the field "name".

Test

Execute the LDPath on the Context:

Context:
LD-Path:

Format: (Accept header set to the request)

Other LDPath Examples: