org.eaglei.repository
Class NamedGraph

java.lang.Object
  extended by org.eaglei.repository.NamedGraph
All Implemented Interfaces:
java.lang.Comparable<NamedGraph>

public class NamedGraph
extends java.lang.Object
implements java.lang.Comparable<NamedGraph>

Named Graph object model, reflects the named graph's properties

Version:
$Id: $
Author:
Larry Stone Started June 7, 2010

Nested Class Summary
static class NamedGraph.Type
          The allowable named graph types.
 
Method Summary
 void commit(javax.servlet.http.HttpServletRequest request)
          commit - commit any changes made to this object (and any others)
 int compareTo(NamedGraph o)
          
 boolean equals(java.lang.Object b)
          
static NamedGraph find(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI name)
          Returns a named graph object, or null if this is not a valid named graph OR context.
static NamedGraph find(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI name, boolean createp)
          Returns a named graph object, or null if this is not a valid named graph OR context and createp was false.
static java.util.Collection<NamedGraph> findAll(javax.servlet.http.HttpServletRequest request)
          Get an iterable collection of all known named graphs AND Contexts.
 java.lang.String getLabel()
          Getter for the field label.
 org.openrdf.model.URI getName()
          Getter for the field name.
 NamedGraph.Type getType()
          Getter for the field type.
 java.lang.String getTypeLabel()
          Getter for the field typeLabel.
 org.openrdf.model.URI getTypeURI()
          Getter for the field type, but returns URI form.
 boolean isAnonymousReadable()
          Can be read by anonymous user (i.e.
 boolean isManaged()
          When true, graph has metadata and is managed by repository.
 void setLabel(javax.servlet.http.HttpServletRequest request, java.lang.String nl)
          Setter for the field label.
 void setType(javax.servlet.http.HttpServletRequest request, NamedGraph.Type nt)
          Setter for the field type.
 void setType(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI nt)
          Setter for the field type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findAll

public static java.util.Collection<NamedGraph> findAll(javax.servlet.http.HttpServletRequest request)
                                                throws javax.servlet.ServletException
Get an iterable collection of all known named graphs AND Contexts. If there is no Named Graph metadata for a Sesame context, its isManaged() method will return false. Note that named graphs are ONLY listed ONCE even if there is duplicate metadata.

Parameters:
request - a HttpServletRequest object.
Returns:
all named graphs in a Collection object.
Throws:
javax.servlet.ServletException - if any.

find

public static NamedGraph find(javax.servlet.http.HttpServletRequest request,
                              org.openrdf.model.URI name)
                       throws javax.servlet.ServletException
Returns a named graph object, or null if this is not a valid named graph OR context.

Parameters:
request - a HttpServletRequest object.
name - name of named-graph or context, a URI object.
Returns:
a NamedGraph object representing named graph, or null if no graph or context exists.
Throws:
javax.servlet.ServletException - if any.

find

public static NamedGraph find(javax.servlet.http.HttpServletRequest request,
                              org.openrdf.model.URI name,
                              boolean createp)
                       throws javax.servlet.ServletException
Returns a named graph object, or null if this is not a valid named graph OR context and createp was false.

Parameters:
request - a HttpServletRequest object.
name - name of named-graph or context, a URI object.
createp - a boolean, true if graph should be created
Returns:
a NamedGraph object representing named graph, or null if no graph or context exists UNLESS createp is true.
Throws:
javax.servlet.ServletException - if any.

getName

public org.openrdf.model.URI getName()

Getter for the field name.

Returns:
a URI object.

getLabel

public java.lang.String getLabel()

Getter for the field label.

Returns:
a String object.

getType

public NamedGraph.Type getType()

Getter for the field type.

Returns:
a URI object.

getTypeURI

public org.openrdf.model.URI getTypeURI()

Getter for the field type, but returns URI form.

Returns:
a URI object.

getTypeLabel

public java.lang.String getTypeLabel()

Getter for the field typeLabel.

Returns:
a String object.

isAnonymousReadable

public boolean isAnonymousReadable()
Can be read by anonymous user (i.e. general public) if true.

Returns:
a boolean, true if graph is publically readable.

isManaged

public boolean isManaged()
When true, graph has metadata and is managed by repository. False for unmanaged sesame contexts.

Returns:
a boolean, true when graph is known NamedGraph.

setLabel

public void setLabel(javax.servlet.http.HttpServletRequest request,
                     java.lang.String nl)
              throws javax.servlet.ServletException

Setter for the field label.

Parameters:
request - a HttpServletRequest object.
nl - a String object.
Throws:
javax.servlet.ServletException - if any.

setType

public void setType(javax.servlet.http.HttpServletRequest request,
                    org.openrdf.model.URI nt)
             throws javax.servlet.ServletException

Setter for the field type.

Parameters:
request - a HttpServletRequest object.
nt - a NamedGraph.Type object.
Throws:
javax.servlet.ServletException - if any.

setType

public void setType(javax.servlet.http.HttpServletRequest request,
                    NamedGraph.Type nt)
             throws javax.servlet.ServletException

Setter for the field type.

Parameters:
request - a HttpServletRequest object.
nt - a URI object.
Throws:
javax.servlet.ServletException - if any.

commit

public void commit(javax.servlet.http.HttpServletRequest request)
            throws javax.servlet.ServletException

commit - commit any changes made to this object (and any others)

Parameters:
request - a HttpServletRequest object.
Throws:
javax.servlet.ServletException - if any.

equals

public boolean equals(java.lang.Object b)

Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(NamedGraph o)

Specified by:
compareTo in interface java.lang.Comparable<NamedGraph>


Copyright © 2009-2010 Eagle-I. All Rights Reserved.