Class InputSourceFactory
java.lang.Object
tech.oxfordsemantic.jrdfox.client.InputSourceFactory
public class InputSourceFactory
extends java.lang.Object
Encapsulates information about a source that can be imported into RDFox. Concrete instances
of this class can be created using static methods.
-
Method Summary
Modifier and Type Method Description java.lang.String
getBaseIRI()
Returns the base IRI of this input source.java.lang.Object
getContent()
Returns the content of this input source.java.lang.String
getName()
Returns the name of this input source.static InputSourceFactory
newInputSourceFactory(java.io.File file)
Creates an input source that provides data to RDFox by reading the specified file.static InputSourceFactory
newInputSourceFactory(java.lang.String name, java.lang.String baseIRI, java.io.InputStream content)
Creates an input source that provides data to RDFox by reading the specified input stream.static InputSourceFactory
newInputSourceFactory(java.lang.String name, java.lang.String baseIRI, java.lang.String content)
Creates an input source that provides data to RDFox by reading the specified string.static InputSourceFactory
newInputSourceFactory(java.net.URI uri)
Creates an input source that provides data to RDFox by reading the specified URI.static InputSourceFactory
newInputSourceFactory(java.net.URL url)
Creates an input source that provides data to RDFox by reading the specified URL.
-
Method Details
-
getName
public java.lang.String getName()Returns the name of this input source. This name is used by RDFox to identify the input source in places such as error messages. For example, if there is an error in the input, the name of the input source will be included into the error message.- Returns:
- the name of this input source
-
getBaseIRI
public java.lang.String getBaseIRI()Returns the base IRI of this input source. This IRI is used by RDFox to resolve relative IRIs during content parsing.- Returns:
- the base IRI of this input source
-
getContent
public java.lang.Object getContent()Returns the content of this input source.- Returns:
- the content of this input source
-
newInputSourceFactory
Creates an input source that provides data to RDFox by reading the specified file. The name of the input source is taken to be the file name, and the base IRI is obtained by converting the file name to an IRI.- Parameters:
file
- provides the location of the data- Returns:
- the input source that provides access to the specified file
-
newInputSourceFactory
Creates an input source that provides data to RDFox by reading the specified URL. Both the name and the base IRI of the input source are obtained from the URL.- Parameters:
url
- provides the location of the data- Returns:
- the input source that provides access to the specified file
-
newInputSourceFactory
Creates an input source that provides data to RDFox by reading the specified URI. Both the name and the base IRI of the input source are obtained from the URI.- Parameters:
uri
- provides the location of the data- Returns:
- the input source that provides access to the specified file
-
newInputSourceFactory
public static InputSourceFactory newInputSourceFactory(java.lang.String name, java.lang.String baseIRI, java.lang.String content)Creates an input source that provides data to RDFox by reading the specified string.- Parameters:
name
- the name of the input sourcebaseIRI
- the base IRI of the input sourcecontent
- provides the content to the imported- Returns:
- the input source that provides access to the specified string
-
newInputSourceFactory
public static InputSourceFactory newInputSourceFactory(java.lang.String name, java.lang.String baseIRI, java.io.InputStream content)Creates an input source that provides data to RDFox by reading the specified input stream.- Parameters:
name
- the name of the input sourcebaseIRI
- the base IRI of the input sourcecontent
- provides the content to the imported- Returns:
- the input source that provides access to the specified input stream
-