de.fuberlin.wiwiss.ng4j.semwebclient
Class SemanticWebClient

java.lang.Object
  extended by de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIO
      extended by de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetImpl
          extended by de.fuberlin.wiwiss.ng4j.semwebclient.SemanticWebClient
All Implemented Interfaces:
NamedGraphSet

public class SemanticWebClient
extends NamedGraphSetImpl

The SematicWebClient interface enables applications to access the Semantic Web.

The Semantic Web is represended as a single, global RDF graph. The library enables applications to query this global graph using SPARQL- and find(SPO) queries. To answer queries, the library dynamically retrieves information from the Semantic Web.

During the execution of a query, information about all resources that appear in triple patterns and in the query results is dynamically loaded from the Semantic Web by:

Internally, retrieved information is represented as a set of named graphs, which allows applications to keep track of information provenance.

If the result of dereferencing a URI is a RDF graph, the graph is added as a named graph (named with the retrieval URI) to graph set.
Within each graphset there is a graph http://localhost/provenanceInformation, which contains provenance information for each retrieved graph. The graph contains a swp:sourceURL and a swp:retrievalTimestamp triple for each retrieved graph. More information about the Semantic Web Client is found on the project's website: http://sites.wiwiss.fu-berlin.de/suhl/bizer/ng4j/semwebclient/

Author:
Chris Bizer (chris@bizer.de), Richard Cyganiak (richard@cyganiak.de), Tobias Gauß (tobias.gauss@web.de)

Field Summary
 String CONFIG_ENABLEGRDDL
           
 String CONFIG_MAXFILESIZE
           
 String CONFIG_MAXGRAPHS
           
 String CONFIG_MAXSTEPS
           
 String CONFIG_MAXTHREADS
           
 String CONFIG_TIMEOUT
           
 
Constructor Summary
SemanticWebClient()
          Creates a Semantic Web Client.
 
Method Summary
 void addGraph(NamedGraph graph)
          Adds a NamedGraph to the set.
 void addRemoteGraph(String uri)
          Adds a remote graph to the graphset.
 Graph asJenaGraph(Node defaultGraphForAdding)
          Returns the union graph of the NamedGraphSet.
 void close()
          Determines all retrieval threads.
 SemWebIterator find(TripleMatch pattern)
          Finds Triples that match a triple pattern.
 void find(TripleMatch pattern, TripleListener listener)
          Finds Triples that match a triple pattern.
 String getConfig(String option)
          Returns the value of a given configuration option.
 boolean isClosed()
          Returns true if the SemanticWebCliend is already closed false if not.
 void reloadRemoteGraph(String uri)
          Reloads a remote graph.
 boolean requestDereferencing(String uri, int step, DereferencingListener listener)
          Initiates a new retrieval process for a given uri.
 void setConfig(String option, String value)
          Sets a configuration option.
 List successfullyDereferencedURIs()
          Returns an iterator over all successfully dereferenced URIs.
 List unsuccessfullyDereferencedURIs()
          Returns an iterator over all URIs that couldn't be dereferenced.
 
Methods inherited from class de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetImpl
addQuad, asJenaModel, clear, containsGraph, containsGraph, containsQuad, countGraphs, countQuads, createGraph, createGraph, createNamedGraphInstance, findQuads, findQuads, getGraph, getGraph, isEmpty, listGraphs, removeGraph, removeGraph, removeQuad
 
Methods inherited from class de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetIO
read, read, read, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.fuberlin.wiwiss.ng4j.NamedGraphSet
read, read, read, write, write
 

Field Detail

CONFIG_MAXSTEPS

public String CONFIG_MAXSTEPS

CONFIG_MAXTHREADS

public String CONFIG_MAXTHREADS

CONFIG_TIMEOUT

public String CONFIG_TIMEOUT

CONFIG_MAXGRAPHS

public String CONFIG_MAXGRAPHS

CONFIG_MAXFILESIZE

public String CONFIG_MAXFILESIZE

CONFIG_ENABLEGRDDL

public String CONFIG_ENABLEGRDDL
Constructor Detail

SemanticWebClient

public SemanticWebClient()
Creates a Semantic Web Client.

Method Detail

find

public SemWebIterator find(TripleMatch pattern)
Finds Triples that match a triple pattern. The argument may contain wildcards (Node.ANY). The implementation of the find method uses multithreading, thus the first triples can already be used while there is still information being retrieved in the background. Returned triples have a getSource() method which returns the URL from which the triple was retrieved.

Parameters:
pattern -
Returns:

find

public void find(TripleMatch pattern,
                 TripleListener listener)
Finds Triples that match a triple pattern. The argument may contain wildcards (Node.ANY). The implementation of the find method uses multithreading, thus the first triples can already be used while there is still information being retrieved in the background. This method is called with a TripleListener as second parameter which is notified each time when a triple is found and when the retrieval process is finished.

Parameters:
pattern -

addRemoteGraph

public void addRemoteGraph(String uri)
Adds a remote graph to the graphset. The graph is retrieved by dereferencing the URI.

Parameters:
seconds -

reloadRemoteGraph

public void reloadRemoteGraph(String uri)
Reloads a remote graph. The current graph is replaced by the new graph.

Parameters:
seconds -

setConfig

public void setConfig(String option,
                      String value)
Sets a configuration option. Possible options are "maxsteps" for the maximum retrieval steps ,"timeout" for the timeout and "maxthreads" for the maximum of simultaneous working DereferencerThreads .


getConfig

public String getConfig(String option)
Returns the value of a given configuration option.


successfullyDereferencedURIs

public List successfullyDereferencedURIs()
Returns an iterator over all successfully dereferenced URIs.


unsuccessfullyDereferencedURIs

public List unsuccessfullyDereferencedURIs()
Returns an iterator over all URIs that couldn't be dereferenced.


close

public void close()
Determines all retrieval threads. Has to be called to determine a Sementic Web Client.

Specified by:
close in interface NamedGraphSet
Overrides:
close in class NamedGraphSetImpl

isClosed

public boolean isClosed()
Returns true if the SemanticWebCliend is already closed false if not.


asJenaGraph

public Graph asJenaGraph(Node defaultGraphForAdding)
Description copied from interface: NamedGraphSet
Returns the union graph of the NamedGraphSet. The graph is backed by the NamedGraphSet: Subsequent changes to one are reflected in the other.

Add operations to the union graph are all written to the default graph specified as the argument.

Delete operations remove the triple from all NamedGraphs.

Specified by:
asJenaGraph in interface NamedGraphSet
Overrides:
asJenaGraph in class NamedGraphSetImpl
Parameters:
defaultGraphForAdding - The name of the default graph used for adding triples; must be an URI
Returns:
A Graph view on the NamedGraphSet

addGraph

public void addGraph(NamedGraph graph)
Description copied from interface: NamedGraphSet
Adds a NamedGraph to the set. Will replace a NamedGraph with the same name that is already in the set.

Specified by:
addGraph in interface NamedGraphSet
Overrides:
addGraph in class NamedGraphSetImpl
Parameters:
graph - The NamedGraph to be added

requestDereferencing

public boolean requestDereferencing(String uri,
                                    int step,
                                    DereferencingListener listener)
Initiates a new retrieval process for a given uri.