Procedural Values

From Developer Documents
Revision as of 12:23, 14 December 2011 by Hannu Niemisto (talk | contribs) (Created page with "It is possible to define procedural values in the graph and compute their values using graph interface. Currently the methods for computing the values are: * <T> T getRelatedVal...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

It is possible to define procedural values in the graph and compute their values using graph interface.

Currently the methods for computing the values are:

  • <T> T getRelatedValue2(Resource subject, Resource relation) throws DatabaseException;
  • <T> T getPossibleRelatedValue2(Resource subject, Resource relation) throws DatabaseException;
  • <T> T getRelatedValue2(Resource subject, Resource relation, Object context) throws DatabaseException;
  • <T> T getPossibleRelatedValue2(Resource subject, Resource relation, Object context) throws DatabaseException;
  • <T> T getRelatedValue2(Resource subject, Resource relation, Binding binding) throws DatabaseException;
  • <T> T getPossibleRelatedValue2(Resource subject, Resource relation, Binding binding) throws DatabaseException;
  • <T> T getRelatedValue2(Resource subject, Resource relation, Object context, Binding binding) throws DatabaseException;
  • <T> T getPossibleRelatedValue2(Resource subject, Resource relation, Object context, Binding binding) throws DatabaseException;

These methods work like getRelatedValue and getPossibleRelatedValue -methods. They follow the given relation from the given subject and then determine the value based on the resource found. If the resource is a literal, then they work exactly like getRelatedValue and getPossibleRelatedValue. They however extend the old functionality in two ways:

  • If the found resource is an instance of ExternalValue, then the URI of the resource is used to find a value that is declared using extensions and Java annotations.
  • If the found resource is an instance of Value, the mechanisms first finds the property ConvertsToValueWith of the value and uses it compute the value.

These two mechanisms are detailed below.

External values

Contextual values