-
Notifications
You must be signed in to change notification settings - Fork 6
LDPlugin
The LDPlugin loads the Linked Data resource for the annotations.
- Asynchronous loading of the resources and referenced reources
- Adding a Promise object on the annotation getting the linked entities. (See jQuery.Deferred Object). The promise delivers an array of VIE instances.
- The fulfilled promise also means that some convenience methods are implemented on the annotation object like
getLabel()
,getDescription()
,getDepiction()
, etc.
-
followRedirects
: An array of property URIs, CURIEs or methods to dereference redirects. See Follow Redirects.
When dereferencing an annotation, the LDPlugin tries to find and preload the entities that have the properties that are
needed by the plugins. For the simple use case these are label, description and depiction. It can happen, that a DBPedia
entity gets restructured and changed to a wikipage redirect (the change happens directly on wikipedia) and the annotated
entity doesn't have any "useful" properties any more, everything can be found at the redirect target entity. The only
property that can still help us further is the dbpedia:wikiPageRedirects
property. The LDPlugin follows such properties
and loads these further entities. When a plugin requests for a property using for example getLabel()
, the API looks for
the property in the first (original) entity and if the property is set, it returns it. If the property is missing in that
entity, if looks into the next (redirected) entity and so on.
The redirect property can also be defined as a method of the following form: (CoffeeScript notation)
(ent) ->
engName = VIE.Util.getPreferredLangForPreferredProperty(ent, ['rdfs:label', 'geonames:alternateName'], ["en"])
if engName
return "http://dbpedia.org/resource/#{engName.replace(/\s/g, '_')}"
This method takes the entity as its only argument, figures out the english label of it and builds and returns a DBPedia resource URI using the english label.
- VIE library
- uses an Apache Stanbol endpoint (default:
http://dev.iks-project.eu:8081
) - The played video has to have annotations
None
-
annotation.entities
: the loaded annotation array. This is guaranteed from the time when the promise object is fulfilled. -
annotation.getLabel()
: Looks up the label of the resource in the preferred language defined inoptions.preferredLanguage
-
annotation.geDepiction(options)
: Looks up the (foaf:) depiction of the annotation resource. Theoptions
parameter is optional can take one ofwith: <string>
orwithout: <string>
parameter. E.g.annotation.geDepiction({without: 'thumb'})
would try to find a depiction that doesn't contain the string 'thumb'. If it's not possible to find such, it falls back to the one with the string.with
works the same way. -
annotation.getDescription()
: Looks up the description of the resource in the preferred language defined inoptions.preferredLanguage
(to be implemented) -
annotation.getPage
: Looks up the Homepage (foaf:page) of the annotation resource. If it's not present, it tries to build a wikipedia link based on the users preferred language.
None