de.fuberlin.wiwiss.ng4j.swp.impl
Class SWPNamedGraphSetImpl

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.swp.impl.SWPNamedGraphSetImpl
All Implemented Interfaces:
NamedGraphSet, SWPNamedGraphSet

public class SWPNamedGraphSetImpl
extends NamedGraphSetImpl
implements SWPNamedGraphSet

Last commit info : $Author: erw $ $Date: 2005/10/29 18:35:36 $ $Revision: 1.13 $

Author:
Chris Bizer., Rowland Watkins.

Constructor Summary
SWPNamedGraphSetImpl()
           
 
Method Summary
 boolean assertGraphs(ArrayList listOfGraphNames, SWPAuthority authority, ArrayList listOfAuthorityProperties)
          Given an list of graph names and an SWP authority, assert each listed graph with this authority.
 boolean assertGraphsWithSignature(ArrayList listOfGraphURIs, SWPAuthority authority, Node signatureMethod, Node digestMethod, ArrayList listOfAuthorityProperties, String keystore, String password)
          Given an list of graphs and an SWP Authority, assert each graph in the graphset with this Authority.
 boolean assertWithSignature(SWPAuthority authority, Node signatureMethod, Node digestMethod, ArrayList listOfAuthorityProperties, String keystore, String password)
          Same as swpAssert, except instead of simply asserting a graph, we sign the asserted graph with a digital signature according to the specified signatureMethod.
protected  NamedGraph createNamedGraphInstance(Node graphName)
           
protected  SWPNamedGraph createNewWarrantGraph()
           
 ExtendedIterator getAllAssertedGraphs(SWPAuthority authority)
          Returns an iterator over all named graphs asserted by a given authority.
 ExtendedIterator getAllQuotedGraphs(SWPAuthority authority)
          Returns an iterator over all named graphs quoted by a given authority.
 ExtendedIterator getAllWarrants(SWPAuthority authority)
          Returns an iterator over all SWPWarrants for a given authority.
 boolean quoteGraphs(ArrayList listOfGraphNames, SWPAuthority authority, ArrayList listOfAuthorityProperties)
           
 boolean quoteWithSignature(SWPAuthority authority, Node signatureMethod, Node digestMethod, ArrayList listOfAuthorityProperties, String keystore, String password)
          Same as swpQuote, except instead of simply quoting a graph, we sign the quoted graph with a digital signature according to the specified signatureMethod.
 boolean swpAssert(SWPAuthority authority)
           
 boolean swpAssert(SWPAuthority authority, ArrayList listOfAuthorityProperties)
          Given an SWP Authority, assert all graphs in the graphset with this Authority.
 boolean swpQuote(SWPAuthority authority)
           
 boolean swpQuote(SWPAuthority authority, ArrayList listOfAuthorityProperties)
          Given an SWP Authority, quote all graphs in the graphset with this Authority.
 boolean verifyAllSignatures()
          For all signature graphs in the set, verify all signatures.
 
Methods inherited from class de.fuberlin.wiwiss.ng4j.impl.NamedGraphSetImpl
addGraph, addQuad, asJenaGraph, asJenaModel, clear, close, containsGraph, containsGraph, containsQuad, countGraphs, countQuads, createGraph, createGraph, 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
addGraph, addQuad, asJenaGraph, asJenaModel, clear, close, containsGraph, containsGraph, containsQuad, countGraphs, countQuads, createGraph, createGraph, findQuads, findQuads, getGraph, getGraph, isEmpty, listGraphs, read, read, read, removeGraph, removeGraph, removeQuad, write, write
 

Constructor Detail

SWPNamedGraphSetImpl

public SWPNamedGraphSetImpl()
Method Detail

swpAssert

public boolean swpAssert(SWPAuthority authority,
                         ArrayList listOfAuthorityProperties)
Description copied from interface: SWPNamedGraphSet

Given an SWP Authority, assert all graphs in the graphset with this Authority. This will add a warrant graph asserting all other graphs to the graph set. The listOfAuthorityProperties contains list of properties names (as nodes) describing the authority. These properties will be included into the warrant graph, e.g. foaf:name, foaf:mbox

The new graph will be named using a UUID. If the Authority doesn't have a URI, then a blank node will be used to identify the authority and a additional triple containing the foaf:mbox adress of the authority will be added. Return true if successful.

Specified by:
swpAssert in interface SWPNamedGraphSet
Returns:
boolean

swpAssert

public boolean swpAssert(SWPAuthority authority)
Specified by:
swpAssert in interface SWPNamedGraphSet

swpQuote

public boolean swpQuote(SWPAuthority authority,
                        ArrayList listOfAuthorityProperties)
Description copied from interface: SWPNamedGraphSet

Given an SWP Authority, quote all graphs in the graphset with this Authority.

Quotes are not as strong semantically as assertions. Quotes are really used when using second hand information, i.e. the Authority is not the creator of the original graph.

The listOfAuthorityProperties contains list of properties names (as nodes) describing the authority. These properties will be included into the warrant graph, e.g. foaf:name, foaf:mbox,


swpQuote

public boolean swpQuote(SWPAuthority authority)
Specified by:
swpQuote in interface SWPNamedGraphSet

assertGraphs

public boolean assertGraphs(ArrayList listOfGraphNames,
                            SWPAuthority authority,
                            ArrayList listOfAuthorityProperties)
Description copied from interface: SWPNamedGraphSet
Given an list of graph names and an SWP authority, assert each listed graph with this authority. Return true if successful.

Specified by:
assertGraphs in interface SWPNamedGraphSet
Returns:

quoteGraphs

public boolean quoteGraphs(ArrayList listOfGraphNames,
                           SWPAuthority authority,
                           ArrayList listOfAuthorityProperties)
Specified by:
quoteGraphs in interface SWPNamedGraphSet

assertWithSignature

public boolean assertWithSignature(SWPAuthority authority,
                                   Node signatureMethod,
                                   Node digestMethod,
                                   ArrayList listOfAuthorityProperties,
                                   String keystore,
                                   String password)
                            throws SWPBadSignatureException,
                                   SWPBadDigestException
Description copied from interface: SWPNamedGraphSet
Same as swpAssert, except instead of simply asserting a graph, we sign the asserted graph with a digital signature according to the specified signatureMethod. Example: :Timestamp { :G1 swp:assertedBy :Timestamp . :G1 swp:digestMethod swp:JjcRdfC14N-sha1 . :G1 swp:digest "..." . :G2 swp:assertedBy :Timestamp . :G2 swp:digestMethod swp:JjcRdfC14N-sha1 . :G2 swp:digest "..." . :Timestamp swp:assertedBy :Timestamp . :Timestamp swp:authority . :Timestamp swp:signatureMethod swp:JjcRdfC14N-rsa-sha1 . :Timestamp swp:signature "..." } The listOfAuthorityProperties contains list of properties names (as nodes) describing the authority. These properties will be included into the warrant graph, e.g. foaf:name, foaf:mbox, swp:key, swp:certificate Return true is successful.

Specified by:
assertWithSignature in interface SWPNamedGraphSet
Returns:
Throws:
SWPBadSignatureException
SWPBadDigestException

quoteWithSignature

public boolean quoteWithSignature(SWPAuthority authority,
                                  Node signatureMethod,
                                  Node digestMethod,
                                  ArrayList listOfAuthorityProperties,
                                  String keystore,
                                  String password)
                           throws SWPBadSignatureException
Description copied from interface: SWPNamedGraphSet
Same as swpQuote, except instead of simply quoting a graph, we sign the quoted graph with a digital signature according to the specified signatureMethod. Example: :Timestamp { :G1 swp:quotedBy :Timestamp . :G1 swp:digestMethod swp:JjcRdfC14N-sha1 . :G1 swp:digest "..." . :G2 swp:quotedBy :Timestamp . :G2 swp:digestMethod swp:JjcRdfC14N-sha1 . :G2 swp:digest "..." . :Timestamp swp:assertedBy :Timestamp . :Timestamp swp:authority . :Timestamp swp:signatureMethod swp:JjcRdfC14N-rsa-sha1 . :Timestamp swp:signature "..." } The listOfAuthorityProperties contains list of properties names (as nodes) describing the authority. These properties will be included into the warrant graph, e.g. foaf:name, foaf:mbox, swp:key, swp:certificate Return true of successful.

Specified by:
quoteWithSignature in interface SWPNamedGraphSet
Returns:
Throws:
SWPBadSignatureException

assertGraphsWithSignature

public boolean assertGraphsWithSignature(ArrayList listOfGraphURIs,
                                         SWPAuthority authority,
                                         Node signatureMethod,
                                         Node digestMethod,
                                         ArrayList listOfAuthorityProperties,
                                         String keystore,
                                         String password)
                                  throws SWPBadSignatureException
Description copied from interface: SWPNamedGraphSet
Given an list of graphs and an SWP Authority, assert each graph in the graphset with this Authority. Return true if successful.

Specified by:
assertGraphsWithSignature in interface SWPNamedGraphSet
Returns:
Throws:
SWPBadSignatureException

getAllWarrants

public ExtendedIterator getAllWarrants(SWPAuthority authority)
Description copied from interface: SWPNamedGraphSet
Returns an iterator over all SWPWarrants for a given authority.

Specified by:
getAllWarrants in interface SWPNamedGraphSet

getAllAssertedGraphs

public ExtendedIterator getAllAssertedGraphs(SWPAuthority authority)
Description copied from interface: SWPNamedGraphSet
Returns an iterator over all named graphs asserted by a given authority.

Specified by:
getAllAssertedGraphs in interface SWPNamedGraphSet

getAllQuotedGraphs

public ExtendedIterator getAllQuotedGraphs(SWPAuthority authority)
Description copied from interface: SWPNamedGraphSet
Returns an iterator over all named graphs quoted by a given authority.

Specified by:
getAllQuotedGraphs in interface SWPNamedGraphSet

verifyAllSignatures

public boolean verifyAllSignatures()
Description copied from interface: SWPNamedGraphSet
For all signature graphs in the set, verify all signatures. Calling this method requires adding a graph called before. This graph has to contain the public keys and certificates of authorities or root certificates by CAs trusted by the user. The content of this graph will be treated as trustworthy information in the signature verification process. The results of the signature verification process will be added as a new graph called to the graphset. Example graph { :Warrent1 swp:signatureVerification swp:sucessful . :Warrent2 swp:signatureVerification swp:notSucessful . :Warrent3 swp:signatureVerification swp:sucessful } Return true if successful.

Specified by:
verifyAllSignatures in interface SWPNamedGraphSet
Returns:

createNamedGraphInstance

protected NamedGraph createNamedGraphInstance(Node graphName)
Overrides:
createNamedGraphInstance in class NamedGraphSetImpl

createNewWarrantGraph

protected SWPNamedGraph createNewWarrantGraph()