public class XLink extends Object
| Constructor and Description |
|---|
XLink() |
| Modifier and Type | Method and Description |
|---|---|
static int |
computeLevenshteinDistance(CharSequence str1,
CharSequence str2)
Finds and returns the lexicographical distance between two words.
|
static double |
computeStoilosSimilarity(String st1,
String st2)
Computes the similarity of two strings based on metric proposed in the
paper "A String Metric For Ontology Alignment", published in ISWC 2005.
|
void |
connect()
Infer how the identified entities are connected (only direct associations
are considered, i.e.
|
void |
connect(int radius,
ArrayList<Entity> entities,
String endpoint)
Infer how the identified entities are connected.
|
void |
connect(String category)
Infer how the identified entities are connected (only direct associations
are considered, i.e.
|
void |
createSemanticGraph(ArrayList<Entity> entities,
String endpoint)
Creates a semantic graph based on (semantic) connections/relations between
the given set of entities.
|
Entity |
disambiguate(DisambiguationMethod method,
String snippet,
Set<Entity> ambiguousEntities)
Disambiguation of an ambiguous entity occurrence in 'snippet' based on given method.
|
void |
disambiguateEntities(DisambiguationMethod method)
Disambiguates the mined entities based on given disambiguation method.
|
void |
enrich()
Enriches the retrieved entities with semantic information.
|
void |
enrich(Category c,
PropertiesType type)
Enriches the retrieved entities of a specific category with semantic information of PropertiesType
type in language languageISO (optional)
|
void |
enrich(Category c,
PropertiesType type,
String languageCode)
Enriches the retrieved entities of a specific category with semantic information of PropertiesType
type in language languageISO (optional)
|
void |
enrich(Entity e,
PropertiesType type)
Enriches the retrieved entity with semantic information of PropertiesType
type in language languageISO (optional)
|
void |
enrich(Entity e,
PropertiesType type,
String languageCode)
Enriches the retrieved entity with semantic information of PropertiesType
type in language languageISO (optional)
|
void |
enrich(Entity e,
String query,
String endpoint)
Enriches the retrieved entities e with semantic information using query
|
void |
enrich(PropertiesType type)
Enriches the retrieved entities with semantic information of PropertiesType
type in language languageISO (optional)
|
void |
enrich(PropertiesType type,
String languageCode)
Enriches the retrieved entities with semantic information of PropertiesType
type in language languageISO (optional)
|
void |
enrichWithTopURIs()
Enriches the retrieved entities with semantic information, coming from
their top ranked URIs.
|
void |
findCategoriesFrequency()
Estimates the frequency of each category of the retrieved entities.
|
int |
findNumOfIncomingEdges(Entity entity,
int radius)
Finds and returns the number of incoming edges of entity "entity" within
a specific radius (in a graph).
|
void |
findTopEntities()
Finds the top ranked entity of a document.
|
Set<Triple> |
getAssociations()
Returns the associating triples of the entities.
|
TreeMap<Category,Integer> |
getCategoriesFrequency()
Gets the categories frequency of retrieved entities
|
Entity |
getClosestEntity(String entityName,
String category)
Finds the entity with name closest to 'entityName' that belongs to category 'category'
|
String |
getDocumentContent()
Returns the input document content.
|
String |
getDocumentPath()
Returns the input document path.
|
EntityMiningComponent |
getEmc()
Returns the entity mining component.
|
ArrayList<Entity> |
getEntities()
Returns a list with the detected entities.
|
Set<Entity> |
getEntitiesWithName(String label)
Returns the entities of all categories that has as name attribute value the "label".
|
Entity |
getEntity(String entityName,
String category)
Finds the entity with name 'entityName' that belongs to category 'category'
|
EntityMiningComponent |
getEntityMiningComponent()
Returns the entity mining component.
|
TreeSet<Triple> |
getGraph()
Returns the semantic graph of entities.
|
ArrayList<Entity> |
getTopEntities()
Returns a list with the top-K detected entities.
|
void |
link()
Tries to match the detected entities with URIs from the underlying
knowledge bases (i.e.
|
void |
link(Category c)
Tries to match the detected entities, of a specific category c, with URIs from the underlying
knowledge bases (i.e.
|
void |
link(Entity e)
Tries to match the entity e, with URIs from the underlying knowledge
bases (i.e.
|
void |
rankEntities(double f,
double x)
Ranks the retrieved entities based on the following formula
rank = ( # of entity appearances / # of total entities appearances ) * X% +
( # of entity appearances in first f% of text /
# of total entities appearances in first f% of text ) * (1-X)%.
|
void |
rankURIs()
Ranks the retrieved URIs based on their relevance.
|
void |
retrieveEntities(String content,
HashSet<String> acceptedCategoryNames)
Performs entity mining to the given content and according to the given
categories.
|
void |
retrieveEntities(TextExtractor extractor,
HashSet<String> acceptedCategoryNames)
Performs entity mining with the given text extractor and according to the
given categories.
|
ArrayList<Triple> |
retrieveTriples(String templateQueryFile,
String endpoint,
String uri,
String languageCode)
Retrieves the triples of an entity's given URI.
|
void |
setAssociations(Set<Triple> associations)
Sets the associating triples.
|
void |
setCategoriesFrequency(TreeMap<Category,Integer> categoriesFrequency)
Sets the categories frequency.
|
void |
setDocumentContent(String document)
Sets/changes the input document content.
|
void |
setDocumentPath(String documentPath)
Sets/changes the input document path.
|
void |
setEmc(EntityMiningComponent emc)
Sets/changes the entity mining component.
|
void |
setEntities(ArrayList<Entity> entities)
Sets/changes the detected entities.
|
void |
setEntityMiningComponent(EntityMiningComponent emc)
Sets/changes the entity mining component.
|
void |
setTopEntities(ArrayList<Entity> topEntities)
Sets/changes the detected entities.
|
public Graph semGraph
public int noproper
public void setEntityMiningComponent(EntityMiningComponent emc)
emc - The entity mining component.public EntityMiningComponent getEntityMiningComponent()
public void retrieveEntities(TextExtractor extractor, HashSet<String> acceptedCategoryNames) throws FalseFileTypeException
extractor - The text extractor that will be used for getting the
text in which we will perform entity mining.acceptedCategoryNames - The names of the categories for which we
want to detect entities.FalseFileTypeExceptionpublic void retrieveEntities(String content, HashSet<String> acceptedCategoryNames)
content - The text in which we want to perform entity mining.acceptedCategoryNames - The names of the categories for which we
want to detect entities.public void disambiguateEntities(DisambiguationMethod method) throws CategoryNotFoundException, IOException
method - The disambiguation method.CategoryNotFoundExceptionIOExceptionpublic void link()
throws CategoryNotFoundException,
IOException
CategoryNotFoundExceptionIOExceptionpublic void link(Category c) throws CategoryNotFoundException, IOException
c - The category which entities we want to linkCategoryNotFoundExceptionIOExceptionpublic void link(Entity e) throws CategoryNotFoundException, IOException
e - The category which entities we want to linkCategoryNotFoundExceptionIOExceptionpublic void connect(int radius,
ArrayList<Entity> entities,
String endpoint)
throws CategoryNotFoundException,
IOException
radius - Radius of search. For r=0 direct associations are considered,
for r=1 shared property values are allowed, etc.endpoint - The endpoint of the Knowledge Base we want to use.entities - The entities whose connectivity we want to infer.CategoryNotFoundExceptionIOExceptionpublic int findNumOfIncomingEdges(Entity entity, int radius) throws IOException, CategoryNotFoundException
entity - The entity whose number of incoming edges we want to find.radius - The radius within we want to search.IOExceptionCategoryNotFoundExceptionpublic void connect(String category) throws CategoryNotFoundException, IOException
category - The category whose entities we want to connect.CategoryNotFoundExceptionIOExceptionpublic void connect()
throws CategoryNotFoundException,
IOException
CategoryNotFoundExceptionIOExceptionpublic void enrich()
throws CategoryNotFoundException,
IOException
CategoryNotFoundExceptionIOExceptionpublic void enrich(Entity e, PropertiesType type, String languageCode) throws CategoryNotFoundException, IOException, NoProperSPARQLTemplateQuery
e - The identified entity we want to enrich.type - The properties type (e.g. incoming, outgoing etc)languageCode - The language of retrieved properties (optional)CategoryNotFoundExceptionIOExceptionNoProperSPARQLTemplateQuerypublic void enrich(PropertiesType type, String languageCode) throws CategoryNotFoundException, IOException, NoProperSPARQLTemplateQuery
type - The properties type (e.g. incoming, outgoing etc)languageCode - The language of retrieved properties (optional)CategoryNotFoundExceptionIOExceptionNoProperSPARQLTemplateQuerypublic void enrich(Category c, PropertiesType type, String languageCode) throws CategoryNotFoundException, IOException, NoProperSPARQLTemplateQuery
c - The category which entities we want to enrich.type - The properties type (e.g. incoming, outgoing etc)languageCode - The language of retrieved properties (optional)CategoryNotFoundExceptionIOExceptionNoProperSPARQLTemplateQuerypublic void enrich(Entity e, PropertiesType type) throws CategoryNotFoundException, IOException, NoProperSPARQLTemplateQuery
e - The identified entity we want to enrich.type - The properties type (e.g. incoming, outgoing etc)CategoryNotFoundExceptionIOExceptionNoProperSPARQLTemplateQuerypublic void enrichWithTopURIs()
throws CategoryNotFoundException,
IOException,
NoProperSPARQLTemplateQuery
public void enrich(PropertiesType type) throws CategoryNotFoundException, IOException, NoProperSPARQLTemplateQuery
type - The properties type (e.g. incoming, outgoing etc)CategoryNotFoundExceptionIOExceptionNoProperSPARQLTemplateQuerypublic void enrich(Category c, PropertiesType type) throws CategoryNotFoundException, IOException, NoProperSPARQLTemplateQuery
c - The category which entities we want to enrich.type - The properties type (e.g. incoming, outgoing etc)CategoryNotFoundExceptionIOExceptionNoProperSPARQLTemplateQuerypublic void enrich(Entity e, String query, String endpoint) throws CategoryNotFoundException, IOException
e - The entity we want to enrich.query - The SPARQL query we use to enrich entity e.endpoint - The endpointCategoryNotFoundExceptionIOExceptionpublic EntityMiningComponent getEmc()
public void setEmc(EntityMiningComponent emc)
emc - The entity mining component.public ArrayList<Entity> getEntities()
public ArrayList<Entity> getTopEntities()
public void setEntities(ArrayList<Entity> entities)
entities - The entities.public void setTopEntities(ArrayList<Entity> topEntities)
topEntities - The entities.public void setDocumentContent(String document)
document - The input documentpublic String getDocumentContent()
public void setDocumentPath(String documentPath)
documentPath - The input documentpublic String getDocumentPath()
public static int computeLevenshteinDistance(CharSequence str1, CharSequence str2)
str1 - The first word.str2 - The second word.public ArrayList<Triple> retrieveTriples(String templateQueryFile, String endpoint, String uri, String languageCode) throws IOException
templateQueryFile - The template query for retrieving triples.endpoint - The endpoint of a knowledge baseuri - An entity's URI.languageCode - The ISO code of a language.IOExceptionpublic Set<Triple> getAssociations()
public void setAssociations(Set<Triple> associations)
associations - The associating triples.public Set<Entity> getEntitiesWithName(String label)
label - The value of name attribute of the entities that we want to return.public void rankEntities(double f,
double x)
f - The percentage of document we want to check.x - The weight we give to the 1st part of sum and 1-x the weight
we give to the 2nd part of sum.public void rankURIs()
throws IOException
IOExceptionpublic void findTopEntities()
public TreeMap<Category,Integer> getCategoriesFrequency()
public void setCategoriesFrequency(TreeMap<Category,Integer> categoriesFrequency)
categoriesFrequency - The categories frequency.public void findCategoriesFrequency()
throws CategoryNotFoundException
CategoryNotFoundExceptionpublic Entity getEntity(String entityName, String category)
entityName - The name of the entity we want to find.category - The category of the entity.public Entity getClosestEntity(String entityName, String category)
entityName - The name of the entity we want to find.category - The category of the entity.public static double computeStoilosSimilarity(String st1, String st2)
st1 - The 1st string.st2 - The 2nd string.public Entity disambiguate(DisambiguationMethod method, String snippet, Set<Entity> ambiguousEntities) throws CategoryNotFoundException, IOException
method - The method we use to disambiguate an entity occurrence in 'snippet'.snippet - The textual snippet that contains one or more occurrences of an ambiguous entity.ambiguousEntities - The set of ambiguous entities.CategoryNotFoundExceptionIOExceptionpublic void createSemanticGraph(ArrayList<Entity> entities, String endpoint) throws IOException, CategoryNotFoundException
entities - A set of entitiesendpoint - The SPARQL endpoint of the Knowledge Base that contains
the appropriate semantic information of entities.IOExceptionCategoryNotFoundExceptionCopyright © 2016. All rights reserved.