public class Parser extends Object
parse to transform serialized RDF forms into ImmutableGraphs.
Functionality is delegated to registered ParsingProviders. Such
ParsingProviders can be registered and unregistered, later
registered
ParsingProviders shadow previously registered providers for the
same format.
Note on synchronization:
ParsingProviders must be able to handle concurrent requests.| Constructor and Description |
|---|
Parser()
the constructor sets the singleton instance to allow instantiation
by OSGi-DS.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext componentContext) |
protected void |
bindConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin) |
void |
bindParsingProvider(ParsingProvider provider)
Registers a parsing provider
|
protected void |
deactivate(org.osgi.service.component.ComponentContext componentContext) |
static Parser |
getInstance()
This returns the singleton instance, if an instance has been previously
created (e.g.
|
Set<String> |
getSupportedFormats()
Get a set of supported formats
|
void |
parse(Graph target,
InputStream serializedGraph,
String formatIdentifier)
Parses a serialized ImmutableGraph from an InputStream.
|
void |
parse(Graph target,
InputStream serializedGraph,
String formatIdentifier,
IRI baseUri)
Parses a serialized ImmutableGraph from an InputStream.
|
ImmutableGraph |
parse(InputStream serializedGraph,
String formatIdentifier)
Parses a serialized ImmutableGraph from an InputStream.
|
ImmutableGraph |
parse(InputStream serializedGraph,
String formatIdentifier,
IRI baseUri)
Parses a serialized ImmutableGraph from an InputStream.
|
protected void |
unbindConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin) |
void |
unbindParsingProvider(ParsingProvider provider)
Unregister a parsing provider
|
public Parser()
getInstance method should be used.public static Parser getInstance()
protected void activate(org.osgi.service.component.ComponentContext componentContext)
protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
public ImmutableGraph parse(InputStream serializedGraph, String formatIdentifier) throws UnsupportedFormatException
serializedGraph - an inputstream with the serializationformatIdentifier - a string identifying the format (usually the MIME-type)UnsupportedFormatExceptionpublic void parse(Graph target, InputStream serializedGraph, String formatIdentifier) throws UnsupportedFormatException
target - the Graph to which the parsed triples are addedserializedGraph - an inputstream with the serializationformatIdentifier - a string identifying the format (usually the MIME-type)UnsupportedFormatExceptionpublic ImmutableGraph parse(InputStream serializedGraph, String formatIdentifier, IRI baseUri) throws UnsupportedFormatException
serializedGraph - an inputstream with the serializationformatIdentifier - a string identifying the format (usually the MIME-type)baseUri - the uri against which relative uri-refs are evaluatedUnsupportedFormatExceptionpublic void parse(Graph target, InputStream serializedGraph, String formatIdentifier, IRI baseUri) throws UnsupportedFormatException
target - the Graph to which the parsed triples are addedserializedGraph - an inputstream with the serializationformatIdentifier - a string identifying the format (usually the MIME-type)baseUri - the uri against which relative uri-refs are evaluatedUnsupportedFormatExceptionpublic Set<String> getSupportedFormats()
public void bindParsingProvider(ParsingProvider provider)
provider - the provider to be registeredpublic void unbindParsingProvider(ParsingProvider provider)
provider - the provider to be deregisteredprotected void bindConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
protected void unbindConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
Copyright © 2015–2022 The Apache Software Foundation. All rights reserved.