org.apache.stanbol.contenthub.web.resources
Class ContentItemResource

java.lang.Object
  extended by org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
      extended by org.apache.stanbol.contenthub.web.resources.ContentItemResource

public class ContentItemResource
extends org.apache.stanbol.commons.web.base.resource.BaseStanbolResource


Nested Class Summary
static class ContentItemResource.EntityExtractionSummary
           
static class ContentItemResource.EntitySuggestion
           
 
Nested classes/interfaces inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
org.apache.stanbol.commons.web.base.resource.BaseStanbolResource.MenuItem
 
Field Summary
protected  org.apache.stanbol.enhancer.servicesapi.ContentItem contentItem
           
 Map<org.apache.clerezza.rdf.core.UriRef,String> defaultThumbnails
           
static org.apache.clerezza.rdf.core.UriRef DEPICTION
           
protected  URI downloadHref
           
protected  Map<org.apache.clerezza.rdf.core.UriRef,Map<String,ContentItemResource.EntityExtractionSummary>> extractionsByTypeMap
          Map holding the extraction mapped by Properties.DC_TYPE and the Properties.ENHANCER_SELECTED_TEXT.
protected  URI imageSrc
           
protected  String localId
           
protected  URI metadataHref
           
protected  String serializationFormat
           
protected  org.apache.clerezza.rdf.core.serializedform.Serializer serializer
           
static org.apache.clerezza.rdf.core.UriRef SUMMARY
           
protected  org.apache.clerezza.rdf.core.access.TcManager tcManager
           
protected  String textContent
           
static org.apache.clerezza.rdf.core.UriRef THUMBNAIL
           
 
Fields inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
LINK_RESOURCES, NAVIGATION_LINKS, ROOT_URL, SCRIPT_RESOURCES, servletContext, STATIC_RESOURCES_ROOT_URL, SYSTEM_CONSOLE, uriInfo
 
Constructor Summary
ContentItemResource(String localId, org.apache.stanbol.enhancer.servicesapi.ContentItem ci, javax.ws.rs.core.UriInfo uriInfo, String storePath, org.apache.clerezza.rdf.core.access.TcManager tcManager, org.apache.clerezza.rdf.core.serializedform.Serializer serializer, javax.servlet.ServletContext servletContext)
           
 
Method Summary
 javax.ws.rs.core.Response get(javax.ws.rs.core.HttpHeaders headers)
           
 Collection<ContentItemResource.EntityExtractionSummary> getConceptOccurrences()
           
 org.apache.stanbol.enhancer.servicesapi.ContentItem getContentItem()
           
 URI getDownloadHref()
           
 URI getImageSrc()
           
 String getLocalId()
           
 URI getMetadataHref()
           
 Collection<ContentItemResource.EntityExtractionSummary> getOccurrences(org.apache.clerezza.rdf.core.UriRef type)
           
 Collection<ContentItemResource.EntityExtractionSummary> getOrganizationOccurrences()
           
 Collection<ContentItemResource.EntityExtractionSummary> getOtherOccurrences()
           
 Collection<org.apache.clerezza.rdf.core.UriRef> getOtherOccurrencyTypes()
          Used to print occurrences with other types than the natively supported
 Collection<ContentItemResource.EntityExtractionSummary> getPersonOccurrences()
           
 Collection<ContentItemResource.EntityExtractionSummary> getPlaceOccurrences()
           
 String getPlacesAsJSON()
           
 String getRdfMetadata()
           
 String getRdfMetadata(String mediatype)
           
 String getTextContent()
           
 boolean hasOccurrences()
          Checks if there are Occurrences
 void setRdfSerializationFormat(String format)
           
 
Methods inherited from class org.apache.stanbol.commons.web.base.resource.BaseStanbolResource
getConsoleBaseUri, getMainMenuItems, getNavigationLinks, getPublicBaseUri, getRegisteredLinkResources, getRegisteredScriptResources, getRequestUri, getRootUrl, getStaticRootUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUMMARY

public static final org.apache.clerezza.rdf.core.UriRef SUMMARY

THUMBNAIL

public static final org.apache.clerezza.rdf.core.UriRef THUMBNAIL

DEPICTION

public static final org.apache.clerezza.rdf.core.UriRef DEPICTION

defaultThumbnails

public final Map<org.apache.clerezza.rdf.core.UriRef,String> defaultThumbnails

contentItem

protected org.apache.stanbol.enhancer.servicesapi.ContentItem contentItem

localId

protected String localId

textContent

protected String textContent

imageSrc

protected URI imageSrc

downloadHref

protected URI downloadHref

metadataHref

protected URI metadataHref

tcManager

protected final org.apache.clerezza.rdf.core.access.TcManager tcManager

serializer

protected final org.apache.clerezza.rdf.core.serializedform.Serializer serializer

serializationFormat

protected String serializationFormat

extractionsByTypeMap

protected Map<org.apache.clerezza.rdf.core.UriRef,Map<String,ContentItemResource.EntityExtractionSummary>> extractionsByTypeMap
Map holding the extraction mapped by Properties.DC_TYPE and the Properties.ENHANCER_SELECTED_TEXT. This map is initialised by initOccurrences().

Constructor Detail

ContentItemResource

public ContentItemResource(String localId,
                           org.apache.stanbol.enhancer.servicesapi.ContentItem ci,
                           javax.ws.rs.core.UriInfo uriInfo,
                           String storePath,
                           org.apache.clerezza.rdf.core.access.TcManager tcManager,
                           org.apache.clerezza.rdf.core.serializedform.Serializer serializer,
                           javax.servlet.ServletContext servletContext)
                    throws IOException
Throws:
IOException
Method Detail

getRdfMetadata

public String getRdfMetadata(String mediatype)
                      throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

getRdfMetadata

public String getRdfMetadata()
                      throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

getContentItem

public org.apache.stanbol.enhancer.servicesapi.ContentItem getContentItem()

getLocalId

public String getLocalId()

getTextContent

public String getTextContent()

getImageSrc

public URI getImageSrc()

getDownloadHref

public URI getDownloadHref()

getMetadataHref

public URI getMetadataHref()

hasOccurrences

public boolean hasOccurrences()
Checks if there are Occurrences


getOtherOccurrencyTypes

public Collection<org.apache.clerezza.rdf.core.UriRef> getOtherOccurrencyTypes()
Used to print occurrences with other types than the natively supported


getOccurrences

public Collection<ContentItemResource.EntityExtractionSummary> getOccurrences(org.apache.clerezza.rdf.core.UriRef type)

getPersonOccurrences

public Collection<ContentItemResource.EntityExtractionSummary> getPersonOccurrences()
                                                                             throws org.apache.clerezza.rdf.core.sparql.ParseException
Throws:
org.apache.clerezza.rdf.core.sparql.ParseException

getOtherOccurrences

public Collection<ContentItemResource.EntityExtractionSummary> getOtherOccurrences()
                                                                            throws org.apache.clerezza.rdf.core.sparql.ParseException
Throws:
org.apache.clerezza.rdf.core.sparql.ParseException

getOrganizationOccurrences

public Collection<ContentItemResource.EntityExtractionSummary> getOrganizationOccurrences()
                                                                                   throws org.apache.clerezza.rdf.core.sparql.ParseException
Throws:
org.apache.clerezza.rdf.core.sparql.ParseException

getPlaceOccurrences

public Collection<ContentItemResource.EntityExtractionSummary> getPlaceOccurrences()
                                                                            throws org.apache.clerezza.rdf.core.sparql.ParseException
Throws:
org.apache.clerezza.rdf.core.sparql.ParseException

getConceptOccurrences

public Collection<ContentItemResource.EntityExtractionSummary> getConceptOccurrences()
                                                                              throws org.apache.clerezza.rdf.core.sparql.ParseException
Throws:
org.apache.clerezza.rdf.core.sparql.ParseException

setRdfSerializationFormat

public void setRdfSerializationFormat(String format)

getPlacesAsJSON

public String getPlacesAsJSON()
                       throws org.apache.clerezza.rdf.core.sparql.ParseException,
                              UnsupportedEncodingException
Returns:
an RDF/JSON descriptions of places for the word map widget
Throws:
org.apache.clerezza.rdf.core.sparql.ParseException
UnsupportedEncodingException

get

public javax.ws.rs.core.Response get(@Context
                                     javax.ws.rs.core.HttpHeaders headers)


Copyright © 2011-2013 The Apache Software Foundation. All Rights Reserved.