|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TaggingApi
Tag resources to things, saying that this document (resource) is about that topic (thing). Use this API to add tags to resources, remove the tags and list the tags. Many of these calls here use the PimoService to realise them. This is a simplification of PimoService The API can also make suggestions for possible tags of documents. It will use our text-classification system for this.
| Field Summary | |
|---|---|
static String |
API_NAME
|
| Method Summary | |
|---|---|
boolean |
addTagToResource(String tagUri,
String resourceUri)
add a new tag to the passed resource. |
String |
createNewTagForResource(String tagName,
String resourceUri)
Create a new tag and add the resource as occurrence of the tag. |
boolean |
ensureResourceIsInStore(String resourceUri,
String label,
String typeUri,
String fulltext,
String metadataXML)
check if the passed resource is in the resource-store. |
Collection<Tag> |
getPossibleTagsFor(String resourceUri)
get possible tags for this resource, load the fulltext and metadata of the resource from the resource-storage. |
Collection<Tag> |
getPossibleTagsForTagName(String snippet)
Find possible tags that contain the passed name. |
Collection<Tag> |
getPossibleTagsForText(String uri,
String fullText)
get possible tags for this resource, the fulltext of the resource and its uri are passed in. |
Map<Tag,Float> |
getRelatedTagsforTermsWeighted(Collection<String> terms)
Get possible tags and their evidence for list of terms and its uri are passed in. |
Collection<Tag> |
getTagsOf(String resourceUri)
get me the tags that are already associated to this resource. |
Map<String,Collection<Tag>> |
getTagsOfMany(Collection<String> uris)
get the tags of many resources. |
Collection<Tag> |
getTagsWithName(String name)
get tag(s) with exactly this name |
boolean |
removeTag(String tagUri,
String resourceUri)
Remove the occurrence between the resource and the thing. |
| Field Detail |
|---|
static final String API_NAME
| Method Detail |
|---|
@Contains(value=Tag.class)
Collection<Tag> getPossibleTagsFor(String resourceUri)
throws ResourceNotFoundException
resourceUri - the uri of the resource
ResourceNotFoundException - if the passed uri is unknown in the storage
@Contains(value=Tag.class)
Collection<Tag> getPossibleTagsForText(String uri,
String fullText)
throws ResourceNotFoundException
uri - text -
ResourceNotFoundException
Map<Tag,Float> getRelatedTagsforTermsWeighted(Collection<String> terms)
throws Exception
terms - List of terms
Exception@Contains(value=Tag.class) Collection<Tag> getPossibleTagsForTagName(String snippet)
snippet - the string that has to be contained in the thing to be usable as a Tag
@Contains(value=Tag.class) Collection<Tag> getTagsWithName(String name)
name -
@Contains(value=Tag.class)
Collection<Tag> getTagsOf(String resourceUri)
throws ResourceNotFoundException
uri - the uri of the resource in question
ResourceNotFoundExceptionMap<String,Collection<Tag>> getTagsOfMany(Collection<String> uris)
a - list of uris of resource for whom to search for tags.
boolean addTagToResource(String tagUri,
String resourceUri)
throws ResourceNotFoundException,
ThingNotFoundException
tagUri - the uri of the thing that is used to tagresourceUri - the uri of the resource being tagged. The resource already to be stored in resource-store.
This will not be checked, you have to check it before calling.
ResourceNotFoundException - if the resource was not in resource-storage
ThingNotFoundException - it the thing was not in the pimo
String createNewTagForResource(String tagName,
String resourceUri)
throws ResourceNotFoundException
tagName - the name of the tag to createresourceUri - the uri of the resource being tagged. The resource already to be stored in resource-store.
This will not be checked, you have to check it before calling.
ResourceNotFoundException - if the resource was not in resource-storage
boolean removeTag(String tagUri,
String resourceUri)
throws ResourceNotFoundException,
PimoInvalidException,
OntologyReadonlyException
tagUri - the uri of the thing that was used as tagresourceUri - the uri of the resource that was used as tag
ResourceNotFoundException
OntologyReadonlyException
PimoInvalidException
boolean ensureResourceIsInStore(String resourceUri,
String label,
String typeUri,
String fulltext,
String metadataXML)
throws IOException,
DataStoreException
resourceUri - uri of the resourcelabel - label of the resourcetypeUri - type of the resource (RDF type, has to be a uri)fulltext - (optional) fulltext description of the resource (for searching)metadataXML - (optional) metadata of the resource as RDF/XML string.
IOException - when the passed metadataXML is bogus
DataStoreException - if the resource cannot be stored
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||