public class RiotLib extends Object
| Modifier and Type | Field and Description |
|---|---|
static Function<String,String> |
fixupPrefixes
Function applied to undefined prefixes to convert to a URI string
|
static 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 Node |
blankNodeToIri(Node node)
"Skolemize" to a node.
|
static String |
blankNodeToIriString(Node node)
"Skolemize" to a string.
|
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 java.io.Writer (better to use an IndentedWriter over an OutputStream)
|
static Node |
createIRIorBNode(String str)
Implement
<_:....> as a "Node IRI"
that is, use the given label as the BNode internal label. |
static ParserProfile |
createParserProfile(ErrorHandler errorHandler)
Create a
ParserProfile with default settings, and a specific error handler. |
static ParserProfile |
createParserProfile(FactoryRDF factory,
ErrorHandler errorHandler,
boolean checking)
Create a
ParserProfile with default settings, and a specific error handler. |
static ParserProfile |
createParserProfile(FactoryRDF factory,
ErrorHandler errorHandler,
IRIResolver resolver,
boolean checking)
Create a
ParserProfile. |
static DatasetGraph |
dataset(Graph graph)
Deprecated.
|
static ParserProfile |
dftProfile()
Create a
ParserProfile with default settings. |
static FactoryRDF |
factoryRDF()
Create a new (not influenced by anything else)
FactoryRDF
using the default label to blank node scheme. |
static FactoryRDF |
factoryRDF(LabelToNode labelMapping)
Create a new (not influenced 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 prefix is not 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)
Deprecated.
To be removed.
|
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,
boolean newStyle) |
static void |
writePrefixes(org.apache.jena.atlas.io.IndentedWriter out,
PrefixMap prefixMap,
boolean newStyle)
Write prefixes, using
PREFIX |
static void |
writePrefixesOldStyle(org.apache.jena.atlas.io.IndentedWriter out,
PrefixMap prefixMap)
Write prefixes, using
@prefix |
public static final Function<String,String> fixupPrefixes
public static Node blankNodeToIri(Node node)
public static Node createIRIorBNode(String str)
<_:....> as a "Node IRI"
that is, use the given label as the BNode internal label.
Use with care.
Returns a Node_URI.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)
@Deprecated 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)
FactoryRDF
using the label to blank node scheme provided.public static FactoryRDF factoryRDF()
FactoryRDF
using the default label to blank node scheme.public static ParserProfile dftProfile()
ParserProfile with default settings.public static ParserProfile createParserProfile(ErrorHandler errorHandler)
ParserProfile with default settings, and a specific error handler.public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, boolean checking)
ParserProfile with default settings, and a specific error handler.public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, IRIResolver resolver, boolean checking)
ParserProfile.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, boolean newStyle)
public static void writePrefixes(org.apache.jena.atlas.io.IndentedWriter out, PrefixMap prefixMap, boolean newStyle)
PREFIXpublic static void writePrefixesOldStyle(org.apache.jena.atlas.io.IndentedWriter out, PrefixMap prefixMap)
@prefix@Deprecated public static DatasetGraph dataset(Graph graph)
DatasetGraphFactory.wrap(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