Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API - Get all enrichments based on entity x #31

Open
jthomsen opened this issue Jul 18, 2014 · 5 comments
Open

REST API - Get all enrichments based on entity x #31

jthomsen opened this issue Jul 18, 2014 · 5 comments
Labels

Comments

@jthomsen
Copy link
Member

GET /entity/{uuid}/enrichment

Q: is this possible? Does the model support annotations attached entities?

@jthomsen jthomsen changed the title REST API - get me all enrichments based on entity x REST API - Get all enrichments based on entity x Jul 18, 2014
@jthomsen
Copy link
Member Author

jthomsen commented Aug 4, 2014

SPARQL query:

PREFIX linkedtv: <http://data.linkedtv.eu/ontologies/core#>
PREFIX ma: <http://www.w3.org/ns/ma-ont#>
PREFIX oa: <http://www.w3.org/ns/oa#>
PREFIX prov: <http://www.w3.org/ns/prov#>
SELECT DISTINCT ?item
WHERE {
  ?mediaFragment ma:isFragmentOf ?mediaResource . 
  ?mediaFragment a ma:MediaFragment . 
  ?annotationEntity oa:hasTarget ?mediafragment . 
  ?annotationEntity oa:hasBody ?entity . 
  ?entity a linkedtv:Entity . 
  ?annotationRelResource a oa:Annotation . 
  ?annotationRelResource prov:wasDerivedFrom ?entity . 
  ?annotationRelResource oa:hasBody ?item . 
}

@jthomsen
Copy link
Member Author

jthomsen commented Aug 4, 2014

has been realized with the above SPARQL query; sample call

http://data.linkedtv.eu/entity/df7f3f31-3b32-4387-9383-2b2f1045e5f6/enrichment

@rtroncy
Copy link
Member

rtroncy commented Aug 4, 2014

This triple pattern (?mediafragment linkedtv:hasSubtitle ?subtitle ) seems useless.
The triple pattern (?item ma:locator ?url) is useful only if you add ?url in the select clause.
More generally, avoid to put any additional triple patterns that are useless, this is a sub-optimization for the SPARQL endpoint that needs to perform unnecessary check.

@jthomsen
Copy link
Member Author

jthomsen commented Aug 4, 2014

yeah, thanks again (actually I took the (?mediafragment linkedtv:hasSubtitle ?subtitle ) pattern from an example in D2.4 ;-) - was indeed not sure if it's really needed ...

@rtroncy
Copy link
Member

rtroncy commented Aug 4, 2014

It's not ... since you don't use ?subtitle later on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants