public class RdfUtil extends Object
| Constructor and Description |
|---|
RdfUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
append(StringBuilder builder,
Object value) |
static void |
append(StringBuilder builder,
org.openrdf.model.Resource id) |
static List<org.openrdf.model.Namespace> |
collectNamespaces(NamespaceManager nsManager,
Collection<Edge> edgeList) |
static String |
compactId(org.openrdf.model.Resource id,
NamespaceManager nsManager) |
static String |
compactName(Context context,
org.openrdf.model.URI resource) |
static String |
compactName(NamespaceManager nsManager,
org.openrdf.model.Resource resource) |
static int |
countDistinctProperties(Shape shape)
Count the number of distinct PropertyConstraints within a given Shape
|
static String |
curie(org.openrdf.model.URI uri,
NamespaceManager nsManager)
Express a given URI as a Compact URI; fail if the namespace prefix is not defined.
|
static void |
deepCopy(Vertex v,
Graph target) |
static org.openrdf.model.URI |
expand(NamespaceManager nsManager,
String curie) |
static NamespaceManager |
filterNamespaces(Graph graph,
NamespaceManager nsManager)
Filter the namespaces within a given NamespaceManager and produce a new manager that contains only those
namespaces that are used within a certain reference graph.
|
static String |
getDescription(PropertyConstraint p,
Graph graph) |
static String |
getDescription(Vertex subject) |
static String |
getName(Vertex v) |
static String |
idValue(org.openrdf.model.Resource id) |
static boolean |
isSubClassOf(Vertex subject,
org.openrdf.model.Resource target) |
static Object |
javaValue(org.openrdf.model.Literal literal) |
static Object |
javaValue(org.openrdf.model.Value value) |
static List<Vertex> |
listSubtypes(List<Vertex> typeList) |
static void |
loadTurtle(File sourceDir,
Graph graph) |
static void |
loadTurtle(File sourceDir,
Graph graph,
NamespaceManager nsManager)
From a given source directory, load all files with the *.ttl suffix into a given Graph.
|
static void |
loadTurtle(File sourceDir,
Graph graph,
ShapeManager shapeManager) |
static void |
loadTurtle(Graph graph,
InputStream input,
String baseURL) |
static void |
loadTurtle(Graph graph,
NamespaceManager nsManager,
InputStream input,
String baseURL) |
static void |
loadTurtle(Graph graph,
Reader input,
String baseURL) |
static String |
localName(org.openrdf.model.Resource id) |
static org.openrdf.model.URI |
namespace(Graph graph,
String value) |
static boolean |
nearEqual(Object a,
Object b) |
static String |
normalize(String value) |
static String |
optionalCurie(NamespaceManager nsManager,
org.openrdf.model.URI uri) |
static org.openrdf.model.URI |
out(Path path,
int index) |
static void |
prettyPrintTurtle(Graph graph,
OutputStream out) |
static void |
prettyPrintTurtle(Graph graph,
Writer writer) |
static void |
prettyPrintTurtle(NamespaceManager nsManager,
Graph graph,
File file) |
static void |
prettyPrintTurtle(NamespaceManager nsManager,
Graph graph,
Writer writer) |
static void |
prettyPrintTurtle(NamespaceManager nsManager,
String baseIRI,
Graph graph,
Writer writer) |
static void |
prettyPrintTurtle(NamespaceManager nsManager,
String baseIRI,
Graph graph,
Writer writer,
TurtleConfig config) |
static void |
prettyPrintTurtle(String baseIri,
Graph graph,
Writer writer) |
static String |
shortShapeName(org.openrdf.model.Resource id) |
static void |
sortByLocalName(List<PropertyConstraint> properties)
Sort a list of properties alphabetically by local name.
|
static void |
sortByPrefix(List<org.openrdf.model.Namespace> list) |
static List<Vertex> |
subtypeList(Vertex owlClass)
Compute the transitive closure of the subtypes of a given OWL Class.
|
static Set<org.openrdf.model.Resource> |
subTypes(Vertex owlClass) |
static Set<org.openrdf.model.Resource> |
superTypes(Vertex owlClass)
Find the super types of a given OWL Class.
|
static Set<Object> |
toJavaValue(Set<org.openrdf.model.Value> source) |
static String |
toTurtle(org.openrdf.model.Literal literal) |
static org.openrdf.model.URI |
uri(org.openrdf.model.Value value) |
static void |
writeLiteral(PrettyPrintWriter writer,
org.openrdf.model.Literal literal) |
static void |
writeURI(PrettyPrintWriter out,
org.openrdf.model.URI uri) |
public static String compactId(org.openrdf.model.Resource id, NamespaceManager nsManager)
public static String localName(org.openrdf.model.Resource id)
public static int countDistinctProperties(Shape shape)
public static List<org.openrdf.model.Namespace> collectNamespaces(NamespaceManager nsManager, Collection<Edge> edgeList)
public static void sortByLocalName(List<PropertyConstraint> properties)
properties - public static Object javaValue(org.openrdf.model.Value value)
public static void append(StringBuilder builder, org.openrdf.model.Resource id)
public static void append(StringBuilder builder, Object value)
public static String idValue(org.openrdf.model.Resource id)
public static Object javaValue(org.openrdf.model.Literal literal)
public static NamespaceManager filterNamespaces(Graph graph, NamespaceManager nsManager)
graph - The reference graphnsManager - The source NamespaceManager whose namespaces will be filtered based on the reference graphpublic static void sortByPrefix(List<org.openrdf.model.Namespace> list)
public static org.openrdf.model.URI expand(NamespaceManager nsManager, String curie) throws KonigException
KonigExceptionpublic static String curie(org.openrdf.model.URI uri, NamespaceManager nsManager)
uri - nsManager - public static String optionalCurie(NamespaceManager nsManager, org.openrdf.model.URI uri)
public static String getDescription(PropertyConstraint p, Graph graph)
public static void prettyPrintTurtle(Graph graph, OutputStream out) throws IOException, org.openrdf.rio.RDFHandlerException
IOExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static void prettyPrintTurtle(Graph graph, Writer writer) throws IOException, org.openrdf.rio.RDFHandlerException
IOExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static void prettyPrintTurtle(String baseIri, Graph graph, Writer writer) throws IOException, org.openrdf.rio.RDFHandlerException
IOExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static void prettyPrintTurtle(NamespaceManager nsManager, Graph graph, Writer writer) throws IOException, org.openrdf.rio.RDFHandlerException
IOExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static void prettyPrintTurtle(NamespaceManager nsManager, String baseIRI, Graph graph, Writer writer) throws IOException, org.openrdf.rio.RDFHandlerException
IOExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static void prettyPrintTurtle(NamespaceManager nsManager, String baseIRI, Graph graph, Writer writer, TurtleConfig config) throws IOException, org.openrdf.rio.RDFHandlerException
IOExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static void prettyPrintTurtle(NamespaceManager nsManager, Graph graph, File file) throws IOException, org.openrdf.rio.RDFHandlerException
IOExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static void loadTurtle(Graph graph, NamespaceManager nsManager, InputStream input, String baseURL) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.rio.RDFHandlerException
IOExceptionorg.openrdf.rio.RDFParseExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static void loadTurtle(File sourceDir, Graph graph, ShapeManager shapeManager) throws org.openrdf.rio.RDFParseException, org.openrdf.rio.RDFHandlerException, IOException
org.openrdf.rio.RDFParseExceptionorg.openrdf.rio.RDFHandlerExceptionIOExceptionpublic static void loadTurtle(File sourceDir, Graph graph) throws org.openrdf.rio.RDFParseException, org.openrdf.rio.RDFHandlerException, IOException
org.openrdf.rio.RDFParseExceptionorg.openrdf.rio.RDFHandlerExceptionIOExceptionpublic static void loadTurtle(File sourceDir, Graph graph, NamespaceManager nsManager) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.rio.RDFHandlerException
sourceDir - The source directory containing Turtle files.graph - The graph into which RDF statements will be placed.IOExceptionorg.openrdf.rio.RDFParseExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static void loadTurtle(Graph graph, Reader input, String baseURL) throws org.openrdf.rio.RDFParseException, org.openrdf.rio.RDFHandlerException, IOException
org.openrdf.rio.RDFParseExceptionorg.openrdf.rio.RDFHandlerExceptionIOExceptionpublic static void loadTurtle(Graph graph, InputStream input, String baseURL) throws IOException, org.openrdf.rio.RDFParseException, org.openrdf.rio.RDFHandlerException
IOExceptionorg.openrdf.rio.RDFParseExceptionorg.openrdf.rio.RDFHandlerExceptionpublic static Set<org.openrdf.model.Resource> superTypes(Vertex owlClass)
owlClass - The OWL class whose super types are to be found.public static List<Vertex> subtypeList(Vertex owlClass)
owlClass - The OWL Class whose transitive closure is to be computed.public static org.openrdf.model.URI out(Path path, int index)
public static boolean isSubClassOf(Vertex subject, org.openrdf.model.Resource target)
public static String toTurtle(org.openrdf.model.Literal literal)
public static void writeLiteral(PrettyPrintWriter writer, org.openrdf.model.Literal literal)
public static void writeURI(PrettyPrintWriter out, org.openrdf.model.URI uri)
public static String compactName(NamespaceManager nsManager, org.openrdf.model.Resource resource)
public static org.openrdf.model.URI uri(org.openrdf.model.Value value)
public static String shortShapeName(org.openrdf.model.Resource id)
Copyright © 2019. All rights reserved.