org.apache.stanbol.entityhub.servicesapi.site
Interface EntityDereferencer


public interface EntityDereferencer

Service used by ReferencedSite to dereference Representation for entity ids. Implementations of this interface are dependent on the service provided by the referenced site.

Author:
Rupert Westenthaler

Field Summary
static String ACCESS_URI
          The key used to define the baseUri of the service used for the implementation of this interface.
This constants actually uses the value of SiteConfiguration.ACCESS_URI
 
Method Summary
 boolean canDereference(String uri)
          Whether the parsed entity ID can be dereferenced by this Dereferencer or not.
The implementation may not directly check if the parsed URI is present by a query to the site, but only check some patterns of the parsed URI.
 Representation dereference(String uri)
          Dereferences the Representation of the referred Entity
 InputStream dereference(String uri, String contentType)
          Generic getter for the data of the parsed entity id
 String getAccessUri()
          The base uri used to access this site
 

Field Detail

ACCESS_URI

static final String ACCESS_URI
The key used to define the baseUri of the service used for the implementation of this interface.
This constants actually uses the value of SiteConfiguration.ACCESS_URI

See Also:
Constant Field Values
Method Detail

getAccessUri

String getAccessUri()
The base uri used to access this site

Returns:

canDereference

boolean canDereference(String uri)
Whether the parsed entity ID can be dereferenced by this Dereferencer or not.
The implementation may not directly check if the parsed URI is present by a query to the site, but only check some patterns of the parsed URI.

Parameters:
uri - the URI to be checked
Returns:
true of URIs of that kind can be typically dereferenced by this service instance.

dereference

InputStream dereference(String uri,
                        String contentType)
                        throws IOException
Generic getter for the data of the parsed entity id

Parameters:
uri - the entity to dereference
contentType - the content type of the data
Returns:
the data or null if not present or wrong data type TODO: we should use exceptions instead of returning null!
Throws:
IOException

dereference

Representation dereference(String uri)
                           throws IOException
Dereferences the Representation of the referred Entity

Parameters:
uri - the uri of the referred entity
Returns:
the representation of null if no Entity was found for the parsed entity reference.
Throws:
IOException


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.