Package org.apache.any23.rdf
Class Any23ValueFactoryWrapper
- java.lang.Object
-
- org.apache.any23.rdf.Any23ValueFactoryWrapper
-
- All Implemented Interfaces:
org.eclipse.rdf4j.model.ValueFactory
public class Any23ValueFactoryWrapper extends Object implements org.eclipse.rdf4j.model.ValueFactory
Any23 specialization of theValueFactory
. It provides a wrapper to instantiate RDF objects.
-
-
Constructor Summary
Constructors Constructor Description Any23ValueFactoryWrapper(org.eclipse.rdf4j.model.ValueFactory vFactory)
Any23ValueFactoryWrapper(org.eclipse.rdf4j.model.ValueFactory vFactory, IssueReport er)
Any23ValueFactoryWrapper(org.eclipse.rdf4j.model.ValueFactory factory, IssueReport er, String defaultLitLanguage)
Constructor with error reporter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.rdf4j.model.BNode
createBNode()
org.eclipse.rdf4j.model.BNode
createBNode(String id)
org.eclipse.rdf4j.model.IRI
createIRI(String uriStr)
org.eclipse.rdf4j.model.IRI
createIRI(String namespace, String localName)
org.eclipse.rdf4j.model.Literal
createLiteral(boolean b)
org.eclipse.rdf4j.model.Literal
createLiteral(byte b)
org.eclipse.rdf4j.model.Literal
createLiteral(double v)
org.eclipse.rdf4j.model.Literal
createLiteral(float v)
org.eclipse.rdf4j.model.Literal
createLiteral(int i)
org.eclipse.rdf4j.model.Literal
createLiteral(long l)
org.eclipse.rdf4j.model.Literal
createLiteral(short i)
org.eclipse.rdf4j.model.Literal
createLiteral(String content)
org.eclipse.rdf4j.model.Literal
createLiteral(String label, String language)
org.eclipse.rdf4j.model.Literal
createLiteral(String pref, org.eclipse.rdf4j.model.IRI value)
org.eclipse.rdf4j.model.Literal
createLiteral(BigDecimal v)
org.eclipse.rdf4j.model.Literal
createLiteral(BigInteger v)
org.eclipse.rdf4j.model.Literal
createLiteral(Date date)
org.eclipse.rdf4j.model.Literal
createLiteral(XMLGregorianCalendar calendar)
org.eclipse.rdf4j.model.Statement
createStatement(org.eclipse.rdf4j.model.Resource sub, org.eclipse.rdf4j.model.IRI pre, org.eclipse.rdf4j.model.Value obj)
org.eclipse.rdf4j.model.Statement
createStatement(org.eclipse.rdf4j.model.Resource sub, org.eclipse.rdf4j.model.IRI pre, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource context)
org.eclipse.rdf4j.model.IRI
fixIRI(String iri)
org.eclipse.rdf4j.model.IRI
fixLink(String link, String defaultSchema)
Helper method to conditionally add a schema to a URI unless it's there, or null if link is empty.String
fixWhiteSpace(String name)
String
getDefaultLiteralLanguage()
IssueReport
getIssueReport()
org.eclipse.rdf4j.model.IRI
resolveIRI(String uri, URI baseIRI)
Fixes typical errors in IRIs, and resolves relative IRIs against a base IRI.void
setIssueReport(IssueReport er)
-
-
-
Constructor Detail
-
Any23ValueFactoryWrapper
public Any23ValueFactoryWrapper(org.eclipse.rdf4j.model.ValueFactory factory, IssueReport er, String defaultLitLanguage)
Constructor with error reporter.- Parameters:
factory
- the wrapped value factory, cannot benull
.er
- the error reporter.defaultLitLanguage
- the default literal language.
-
Any23ValueFactoryWrapper
public Any23ValueFactoryWrapper(org.eclipse.rdf4j.model.ValueFactory vFactory, IssueReport er)
-
Any23ValueFactoryWrapper
public Any23ValueFactoryWrapper(org.eclipse.rdf4j.model.ValueFactory vFactory)
-
-
Method Detail
-
getIssueReport
public IssueReport getIssueReport()
-
setIssueReport
public void setIssueReport(IssueReport er)
-
getDefaultLiteralLanguage
public String getDefaultLiteralLanguage()
-
createBNode
public org.eclipse.rdf4j.model.BNode createBNode()
- Specified by:
createBNode
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createBNode
public org.eclipse.rdf4j.model.BNode createBNode(String id)
- Specified by:
createBNode
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(String content)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(boolean b)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(byte b)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(short i)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(int i)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(long l)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(float v)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(double v)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(BigDecimal v)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(BigInteger v)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(XMLGregorianCalendar calendar)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(String label, String language)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(String pref, org.eclipse.rdf4j.model.IRI value)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createLiteral
public org.eclipse.rdf4j.model.Literal createLiteral(Date date)
- Specified by:
createLiteral
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createStatement
public org.eclipse.rdf4j.model.Statement createStatement(org.eclipse.rdf4j.model.Resource sub, org.eclipse.rdf4j.model.IRI pre, org.eclipse.rdf4j.model.Value obj)
- Specified by:
createStatement
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createStatement
public org.eclipse.rdf4j.model.Statement createStatement(org.eclipse.rdf4j.model.Resource sub, org.eclipse.rdf4j.model.IRI pre, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource context)
- Specified by:
createStatement
in interfaceorg.eclipse.rdf4j.model.ValueFactory
-
createIRI
public org.eclipse.rdf4j.model.IRI createIRI(String uriStr)
- Specified by:
createIRI
in interfaceorg.eclipse.rdf4j.model.ValueFactory
- Parameters:
uriStr
- input string to create URI from.- Returns:
- a valid sesame IRI or null if any exception occurred
-
createIRI
public org.eclipse.rdf4j.model.IRI createIRI(String namespace, String localName)
- Specified by:
createIRI
in interfaceorg.eclipse.rdf4j.model.ValueFactory
- Returns:
- a valid sesame IRI or null if any exception occurred
-
resolveIRI
public org.eclipse.rdf4j.model.IRI resolveIRI(String uri, URI baseIRI)
Fixes typical errors in IRIs, and resolves relative IRIs against a base IRI.- Parameters:
uri
- A IRI, relative or absolute, can have typical syntax errorsbaseIRI
- A base IRI to use for resolving relative IRIs- Returns:
- An absolute IRI, sytnactically valid, or null if not fixable
-
fixIRI
public org.eclipse.rdf4j.model.IRI fixIRI(String iri)
- Parameters:
iri
- IRI to fix- Returns:
- a valid sesame IRI or null if any exception occurred
-
fixLink
public org.eclipse.rdf4j.model.IRI fixLink(String link, String defaultSchema)
Helper method to conditionally add a schema to a URI unless it's there, or null if link is empty.- Parameters:
link
- string representation of the URIdefaultSchema
- schema to add the URI- Returns:
- a valid sesame IRI or null if any exception occurred
-
-