public class StructurednessCalculator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.openrdf.repository.RepositoryConnection |
con |
Constructor and Description |
---|
StructurednessCalculator() |
Modifier and Type | Method and Description |
---|---|
static long |
getOccurences(java.lang.String predicate,
java.lang.String type,
java.lang.String namedGraph)
Get occurences of a predicate within a type
|
static java.util.Set<java.lang.String> |
getRDFTypes(java.lang.String namedGraph)
Get distinct set of rdf:type
|
static double |
getStructurednessValue(java.lang.String endpointUrl,
java.lang.String namedGraph)
Get the structuredness/coherence value [0,1] of a dataset
|
static long |
getTypeInstancesSize(java.lang.String type,
java.lang.String namedGraph)
Get the number of distinct instances of a specfici type
|
static java.util.Set<java.lang.String> |
getTypePredicates(java.lang.String type,
java.lang.String namedGraph)
Get all distinct predicates of a specific type
|
static double |
getTypesWeightedDenomSum(java.util.Set<java.lang.String> types,
java.lang.String namedGraph)
Get the denominator of weighted sum all types.
|
static void |
initializeRepoConnection(java.lang.String endpointUrl)
Initialize repository for a SPARQL endpoint
|
static void |
main(java.lang.String[] args) |
public static void main(java.lang.String[] args) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
public static double getStructurednessValue(java.lang.String endpointUrl, java.lang.String namedGraph) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException
endpointUrl
- SPARQL endpoint URLnamedGraph
- Named Graph of dataset. Can be null, in that case all named graphs will be consideredorg.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
public static double getTypesWeightedDenomSum(java.util.Set<java.lang.String> types, java.lang.String namedGraph) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException
types
- Set of rdf:typesnamedGraph
- Named graphorg.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
public static long getOccurences(java.lang.String predicate, java.lang.String type, java.lang.String namedGraph) throws java.lang.NumberFormatException, org.openrdf.query.QueryEvaluationException, org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException
predicate
- Predicatetype
- TypenamedGraph
- Named Graphjava.lang.NumberFormatException
org.openrdf.query.QueryEvaluationException
org.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
public static long getTypeInstancesSize(java.lang.String type, java.lang.String namedGraph) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException
type
- Type or class namenamedGraph
- Named graphorg.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
public static java.util.Set<java.lang.String> getTypePredicates(java.lang.String type, java.lang.String namedGraph) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException
type
- Type of classnamedGraph
- Named Graph can be nullorg.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException
public static void initializeRepoConnection(java.lang.String endpointUrl) throws org.openrdf.repository.RepositoryException
endpointUrl
- Endpoint Urlorg.openrdf.repository.RepositoryException
public static java.util.Set<java.lang.String> getRDFTypes(java.lang.String namedGraph) throws org.openrdf.repository.RepositoryException, org.openrdf.query.MalformedQueryException, org.openrdf.query.QueryEvaluationException
namedGraph
- Named Graph of dataset can be null in that case all namedgraphs will be consideredorg.openrdf.repository.RepositoryException
org.openrdf.query.MalformedQueryException
org.openrdf.query.QueryEvaluationException