Package org.apache.jena.riot.system
Class RiotLib
- java.lang.Object
-
- org.apache.jena.riot.system.RiotLib
-
public class RiotLib extends java.lang.ObjectMisc RIOT code
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.function.Function<java.lang.String,java.lang.String>fixupPrefixesFunction applied to undefined prefixes to convert to a URI stringstatic java.util.function.Predicate<java.lang.String>testFixupedPrefixURIFunction to test for undefined prefix URIs
-
Constructor Summary
Constructors Constructor Description RiotLib()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaccTriples(java.util.Collection<Triple> acc, Graph graph, Node s, Node p, Node o)Collect all the matching triplesstatic WriterGraphRIOTBaseadapter(WriterDatasetRIOT writer)static NodeblankNodeToIri(Node node)"Skolemize" to a node.static java.lang.StringblankNodeToIriString(Node node)"Skolemize" to a string.static longcountTriples(Graph graph, Node s, Node p, Node o)static longcountTriples(DatasetGraph dsg, Node s, Node p, Node o)static org.apache.jena.atlas.io.IndentedWritercreate(java.io.Writer writer)IndentedWriter over a java.io.Writer (better to use an IndentedWriter over an OutputStream)static NodecreateIRIorBNode(java.lang.String str)Implement<_:....>as a "Node IRI" that is, use the given label as the BNode internal label.static ParserProfilecreateParserProfile(FactoryRDF factory, ErrorHandler errorHandler, boolean checking)Create aParserProfilewith default settings, and a specific error handler.static ParserProfilecreateParserProfile(FactoryRDF factory, ErrorHandler errorHandler, IRIxResolver resolver, boolean checking)Create aParserProfile.static ParserProfiledftProfile()Create aParserProfilewith default settings.static FactoryRDFfactoryRDF()Create a new (not influenced by anything else)FactoryRDFusing the default label to blank node scheme.static FactoryRDFfactoryRDF(LabelToNode labelMapping)Create a new (not influenced by anything else)FactoryRDFusing the label to blank node scheme provided.static java.lang.StringfixupPrefixIRI(java.lang.String prefixedName)Convert an prefix name (qname) to an IRI, for when the prefix is not defined.static java.lang.StringfixupPrefixIRI(java.lang.String prefix, java.lang.String localPart)Convert an prefix name (qname) to an IRI, for when the prerix is nor defined.static booleanisBNodeIRI(java.lang.String iri)Test whether a IRI is a ARQ-encoded blank node.static booleanisPrefixIRI(java.lang.String iri)Test whether a IRI is a ARQ-encoded blank node.static Nodeparse(java.lang.String string)Parse a string to get one Node (the first token in the string)static PrefixMapprefixMap(Graph graph)static PrefixMapprefixMap(DatasetGraph dsg)static ParserProfileprofile(Lang lang, java.lang.String baseIRI, ErrorHandler handler)static java.util.List<Triple>triples(Graph graph, Node s, Node p, Node o)Get all the triples for the graph.findstatic java.util.Collection<Triple>triplesOfSubject(Graph graph, Node subj)Get triples with the same subjectstatic voidwriteBase(org.apache.jena.atlas.io.IndentedWriter out, java.lang.String base, boolean newStyle)static voidwritePrefix(org.apache.jena.atlas.io.IndentedWriter out, java.lang.String prefix, java.lang.String uri, boolean newStyle)Write a prefix.static voidwritePrefixes(org.apache.jena.atlas.io.IndentedWriter out, PrefixMap prefixMap, boolean newStyle)Write prefixesstatic voidwritePrefixOldStyle(org.apache.jena.atlas.io.IndentedWriter out, java.lang.String prefix, java.lang.String uri, int intent)Write prefixes, using@prefix
-
-
-
Field Detail
-
fixupPrefixes
public static final java.util.function.Function<java.lang.String,java.lang.String> fixupPrefixes
Function applied to undefined prefixes to convert to a URI string
-
testFixupedPrefixURI
public static final java.util.function.Predicate<java.lang.String> testFixupedPrefixURI
Function to test for undefined prefix URIs
-
-
Method Detail
-
blankNodeToIri
public static Node blankNodeToIri(Node node)
"Skolemize" to a node. Returns a Node_URI.
-
blankNodeToIriString
public static java.lang.String blankNodeToIriString(Node node)
"Skolemize" to a string.
-
createIRIorBNode
public static Node createIRIorBNode(java.lang.String str)
Implement<_:....>as a "Node IRI" that is, use the given label as the BNode internal label. Use with care. Returns a Node_URI.
-
isBNodeIRI
public static boolean isBNodeIRI(java.lang.String iri)
Test whether a IRI is a ARQ-encoded blank node.
-
isPrefixIRI
public static boolean isPrefixIRI(java.lang.String iri)
Test whether a IRI is a ARQ-encoded blank node.
-
fixupPrefixIRI
public static java.lang.String fixupPrefixIRI(java.lang.String prefix, java.lang.String localPart)Convert an prefix name (qname) to an IRI, for when the prerix is nor defined.- See Also:
ARQ.fixupUndefinedPrefixes
-
fixupPrefixIRI
public static java.lang.String fixupPrefixIRI(java.lang.String prefixedName)
Convert an prefix name (qname) to an IRI, for when the prefix is not defined.- See Also:
ARQ.fixupUndefinedPrefixes
-
parse
public static Node parse(java.lang.String string)
Parse a string to get one Node (the first token in the string)
-
profile
public static ParserProfile profile(Lang lang, java.lang.String baseIRI, ErrorHandler handler)
-
factoryRDF
public static FactoryRDF factoryRDF(LabelToNode labelMapping)
Create a new (not influenced by anything else)FactoryRDFusing the label to blank node scheme provided.
-
factoryRDF
public static FactoryRDF factoryRDF()
Create a new (not influenced by anything else)FactoryRDFusing the default label to blank node scheme.
-
dftProfile
public static ParserProfile dftProfile()
Create aParserProfilewith default settings.
-
createParserProfile
public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, boolean checking)
Create aParserProfilewith default settings, and a specific error handler.
-
createParserProfile
public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, IRIxResolver resolver, boolean checking)
Create aParserProfile.
-
triplesOfSubject
public static java.util.Collection<Triple> triplesOfSubject(Graph graph, Node subj)
Get triples with the same subject
-
triples
public static java.util.List<Triple> triples(Graph graph, Node s, Node p, Node o)
Get all the triples for the graph.find
-
countTriples
public static long countTriples(DatasetGraph dsg, Node s, Node p, Node o)
-
accTriples
public static void accTriples(java.util.Collection<Triple> acc, Graph graph, Node s, Node p, Node o)
Collect all the matching triples
-
writeBase
public static void writeBase(org.apache.jena.atlas.io.IndentedWriter out, java.lang.String base, boolean newStyle)
-
writePrefixes
public static void writePrefixes(org.apache.jena.atlas.io.IndentedWriter out, PrefixMap prefixMap, boolean newStyle)Write prefixes
-
writePrefix
public static void writePrefix(org.apache.jena.atlas.io.IndentedWriter out, java.lang.String prefix, java.lang.String uri, boolean newStyle)Write a prefix. Write using@prefixorPREFIX.
-
writePrefixOldStyle
public static void writePrefixOldStyle(org.apache.jena.atlas.io.IndentedWriter out, java.lang.String prefix, java.lang.String uri, int intent)Write prefixes, using@prefix
-
prefixMap
public static PrefixMap prefixMap(DatasetGraph dsg)
-
create
public static org.apache.jena.atlas.io.IndentedWriter create(java.io.Writer writer)
IndentedWriter over a java.io.Writer (better to use an IndentedWriter over an OutputStream)
-
adapter
public static WriterGraphRIOTBase adapter(WriterDatasetRIOT writer)
-
-