public class RiotLib extends Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.function.Function<String,String> |
fixupPrefixes
Function applied to undefined prefixes to convert to a URI string
|
static java.util.function.Predicate<String> |
testFixupedPrefixURI
Function to test for undefined prefix URIs
|
| Constructor and Description |
|---|
RiotLib() |
| Modifier and Type | Method and Description |
|---|---|
static void |
accTriples(Collection<Triple> acc,
Graph graph,
Node s,
Node p,
Node o)
Collect all the matching triples
|
static WriterGraphRIOTBase |
adapter(WriterDatasetRIOT writer) |
static int |
calcWidth(PrefixMap prefixMap,
String baseURI,
Collection<Node> nodes,
int minWidth,
int maxWidth) |
static int |
calcWidth(PrefixMap prefixMap,
String baseURI,
Node p) |
static int |
calcWidthTriples(PrefixMap prefixMap,
String baseURI,
Collection<Triple> triples,
int minWidth,
int maxWidth) |
static long |
countTriples(DatasetGraph dsg,
Node s,
Node p,
Node o) |
static long |
countTriples(Graph graph,
Node s,
Node p,
Node o) |
static org.apache.jena.atlas.io.IndentedWriter |
create(Writer writer)
IndentedWriter over a jaav.io.Writer (better to use an IndentedWriter over an OutputStream)
|
static Node |
createIRIorBNode(String iri)
Implement <_:....> as a "Node IRI"
that is, use the given label as the BNode internal label.
|
static DatasetGraph |
dataset(Graph graph)
Returns dataset that wraps a graph
|
static FactoryRDF |
factoryRDF()
Create a new (not influenced by anything else) FactoryRDF
using the label to blank node scheme scope by this FactoryRDF.
|
static FactoryRDF |
factoryRDF(LabelToNode labelMapping)
Create a new (notinfluenced by anything else) FactoryRDF
using the label to blank node scheme provided.
|
static String |
fixupPrefixIRI(String prefixedName)
Convert an prefix name (qname) to an IRI, for when the prerix is nor defined.
|
static String |
fixupPrefixIRI(String prefix,
String localPart)
Convert an prefix name (qname) to an IRI, for when the prerix is nor defined.
|
static boolean |
isBNodeIRI(String iri)
Test whether a IRI is a ARQ-encoded blank node.
|
static boolean |
isPrefixIRI(String iri)
Test whether a IRI is a ARQ-encoded blank node.
|
static Node |
parse(String string)
Parse a string to get one Node (the first token in the string)
|
static PrefixMap |
prefixMap(DatasetGraph dsg) |
static PrefixMap |
prefixMap(Graph graph) |
static ParserProfile |
profile(Lang lang,
String baseIRI) |
static ParserProfile |
profile(Lang lang,
String baseIRI,
ErrorHandler handler) |
static ParserProfile |
profile(String baseIRI,
boolean resolveIRIs,
boolean checking,
ErrorHandler handler)
Create a parser profile for the given setup
|
static boolean |
strSafeFor(String str,
char ch) |
static Triple |
triple1(DatasetGraph dsg,
Node s,
Node p,
Node o)
Get exactly one triple, or null for none or more than one.
|
static Triple |
triple1(Graph graph,
Node s,
Node p,
Node o)
Get exactly one triple or null for none or more than one.
|
static List<Triple> |
triples(Graph graph,
Node s,
Node p,
Node o)
Get all the triples for the graph.find
|
static Collection<Triple> |
triplesOfSubject(Graph graph,
Node subj)
Get triples with the same subject
|
static void |
writeBase(org.apache.jena.atlas.io.IndentedWriter out,
String base) |
static void |
writePrefixes(org.apache.jena.atlas.io.IndentedWriter out,
PrefixMap prefixMap) |
public static final java.util.function.Function<String,String> fixupPrefixes
public static final java.util.function.Predicate<String> testFixupedPrefixURI
public static Node createIRIorBNode(String iri)
public static boolean isBNodeIRI(String iri)
public static boolean isPrefixIRI(String iri)
public static String fixupPrefixIRI(String prefix, String localPart)
ARQ.fixupUndefinedPrefixespublic static String fixupPrefixIRI(String prefixedName)
ARQ.fixupUndefinedPrefixespublic static Node parse(String string)
public static ParserProfile profile(Lang lang, String baseIRI)
public static ParserProfile profile(Lang lang, String baseIRI, ErrorHandler handler)
public static ParserProfile profile(String baseIRI, boolean resolveIRIs, boolean checking, ErrorHandler handler)
baseIRI - Base IRIresolveIRIs - Whether to resolve IRIschecking - Whether to checkhandler - Error handlerfor per-language setuppublic static FactoryRDF factoryRDF(LabelToNode labelMapping)
public static FactoryRDF factoryRDF()
public static Collection<Triple> triplesOfSubject(Graph graph, Node subj)
public static List<Triple> triples(Graph graph, Node s, Node p, Node o)
public static long countTriples(DatasetGraph dsg, Node s, Node p, Node o)
public static void accTriples(Collection<Triple> acc, Graph graph, Node s, Node p, Node o)
public static Triple triple1(Graph graph, Node s, Node p, Node o)
public static Triple triple1(DatasetGraph dsg, Node s, Node p, Node o)
public static boolean strSafeFor(String str, char ch)
public static void writeBase(org.apache.jena.atlas.io.IndentedWriter out, String base)
public static void writePrefixes(org.apache.jena.atlas.io.IndentedWriter out, PrefixMap prefixMap)
public static DatasetGraph dataset(Graph graph)
public static PrefixMap prefixMap(DatasetGraph dsg)
public static int calcWidth(PrefixMap prefixMap, String baseURI, Collection<Node> nodes, int minWidth, int maxWidth)
public static int calcWidthTriples(PrefixMap prefixMap, String baseURI, Collection<Triple> triples, int minWidth, int maxWidth)
public static org.apache.jena.atlas.io.IndentedWriter create(Writer writer)
public static WriterGraphRIOTBase adapter(WriterDatasetRIOT writer)
Licenced under the Apache License, Version 2.0