public class AvatarVerbalizer extends Object implements Comparator<String>
| Modifier and Type | Field and Description |
|---|---|
private static String |
CACHE_DIRECTORY |
private static long |
CACHE_TIME_TO_LIVE
The lifetime of the cache.
|
private static int |
DELAY
The delay that the system will have between sending two queries.
|
private static org.slf4j.Logger |
LOGGER |
protected org.aksw.jena_sparql_api.core.QueryExecutionFactory |
qef |
private Random |
r |
private List<org.apache.jena.rdf.model.Resource> |
resources |
private Set<String> |
sourceClasses |
private Set<String> |
targetClasses |
private IRIConverter |
uriConverter |
private boolean |
useSymmetricCbd |
protected Verbalizer |
verbalizer |
| Modifier | Constructor and Description |
|---|---|
protected |
AvatarVerbalizer(Set<String> sourceClasses,
Set<String> targetClasses,
String endpoint,
String graph,
long seed,
boolean useSymmetricCbd,
org.aksw.jena_sparql_api.core.QueryExecutionFactory qef) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(String s1,
String s2)
Sorts Named entities descending by their length.
|
static AvatarVerbalizer |
create(Set<String> sourceClasses,
Set<String> targetClasses,
String endpoint,
String graph,
long seed,
boolean useSymmetricCbd) |
protected List<org.apache.jena.rdf.model.Statement> |
getCBD(org.apache.jena.rdf.model.Resource res,
Set<String> targetClasses)
Returns list of triples for a given resource and data source
|
private String |
getEnglishLabel(String resource) |
private Map<String,String> |
getLabelsForResources(List<org.apache.jena.rdf.model.Statement> statements) |
protected List<org.apache.jena.rdf.model.Resource> |
getResources(Set<String> classes)
Get all resources that belong to the union of classes and sort them by
URI in desceding order
|
protected List<org.apache.jena.rdf.model.Statement> |
getSymmetricCBD(org.apache.jena.rdf.model.Resource res,
Set<String> targetClasses)
Returns list of triples for a given resource and data source
|
protected List<org.apache.jena.rdf.model.Statement> |
getTriples(org.apache.jena.rdf.model.Resource r)
Gets a set of statements that summarize a resource r
|
protected static org.aksw.jena_sparql_api.core.QueryExecutionFactory |
initQueryExecution(String endpoint,
String graph,
String cacheDirectory) |
org.aksw.gerbil.transfer.nif.Document |
nextDocument() |
protected void |
sortResources(List<org.apache.jena.rdf.model.Resource> resources) |
protected List<org.apache.jena.rdf.model.Statement> |
sortStatements(Set<org.apache.jena.rdf.model.Statement> statements) |
protected List<org.apache.jena.rdf.model.Statement> |
sortStatements(org.apache.jena.rdf.model.StmtIterator stmtIterator) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongprivate static final org.slf4j.Logger LOGGER
private static final int DELAY
private static final long CACHE_TIME_TO_LIVE
private static final String CACHE_DIRECTORY
private boolean useSymmetricCbd
private List<org.apache.jena.rdf.model.Resource> resources
private Random r
private IRIConverter uriConverter
protected Verbalizer verbalizer
protected org.aksw.jena_sparql_api.core.QueryExecutionFactory qef
public static AvatarVerbalizer create(Set<String> sourceClasses, Set<String> targetClasses, String endpoint, String graph, long seed, boolean useSymmetricCbd)
protected List<org.apache.jena.rdf.model.Statement> getSymmetricCBD(org.apache.jena.rdf.model.Resource res, Set<String> targetClasses)
res - targetClasses - protected List<org.apache.jena.rdf.model.Statement> getCBD(org.apache.jena.rdf.model.Resource res, Set<String> targetClasses)
res - targetClasses - protected List<org.apache.jena.rdf.model.Statement> sortStatements(org.apache.jena.rdf.model.StmtIterator stmtIterator)
protected List<org.apache.jena.rdf.model.Statement> sortStatements(Set<org.apache.jena.rdf.model.Statement> statements)
protected List<org.apache.jena.rdf.model.Resource> getResources(Set<String> classes)
classes - Set of classes for resourcesprotected void sortResources(List<org.apache.jena.rdf.model.Resource> resources)
protected List<org.apache.jena.rdf.model.Statement> getTriples(org.apache.jena.rdf.model.Resource r)
r - A resourcepublic org.aksw.gerbil.transfer.nif.Document nextDocument()
private Map<String,String> getLabelsForResources(List<org.apache.jena.rdf.model.Statement> statements)
public int compare(String s1, String s2)
compare in interface Comparator<String>protected static org.aksw.jena_sparql_api.core.QueryExecutionFactory initQueryExecution(String endpoint, String graph, String cacheDirectory) throws ClassNotFoundException, SQLException
ClassNotFoundExceptionSQLExceptionCopyright © 2020. All rights reserved.