diff --git a/doc/RDFService/allclasses-frame.html b/doc/RDFService/allclasses-frame.html
deleted file mode 100644
index 6fe4f7f04..000000000
--- a/doc/RDFService/allclasses-frame.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-All Classes
-
-
-
-
-
-
-
-
-
-
-
-All Classes
-
-
-
-
-
-
diff --git a/doc/RDFService/allclasses-noframe.html b/doc/RDFService/allclasses-noframe.html
deleted file mode 100644
index 2a28b7e01..000000000
--- a/doc/RDFService/allclasses-noframe.html
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-All Classes
-
-
-
-
-
-
-
-
-
-
-
-All Classes
-
-
-
-
-
-
diff --git a/doc/RDFService/constant-values.html b/doc/RDFService/constant-values.html
deleted file mode 100644
index b57508575..000000000
--- a/doc/RDFService/constant-values.html
+++ /dev/null
@@ -1,144 +0,0 @@
-
-
-
-
-
-
-Constant Field Values
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Constant Field Values
-
-
-Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/deprecated-list.html b/doc/RDFService/deprecated-list.html
deleted file mode 100644
index 69fe1da5e..000000000
--- a/doc/RDFService/deprecated-list.html
+++ /dev/null
@@ -1,144 +0,0 @@
-
-
-
-
-
-
-Deprecated List
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Deprecated API
-
-
-Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeListener.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeListener.html
deleted file mode 100644
index fcd08b16f..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeListener.html
+++ /dev/null
@@ -1,259 +0,0 @@
-
-
-
-
-
-
-ChangeListener
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Interface ChangeListener
-
-
-public interface ChangeListener
-
-
-
-An interface for listening to triples that are added to or removed
- from the triple store, and other miscellaneous events.
-
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
- void
-addedStatement (java.lang.String serializedTriple,
- java.lang.String graphURI)
-
-
- Override this to listen to all statements added to the RDF store.
-
-
-
- void
-notifyEvent (java.lang.String graphURI,
- java.lang.Object event)
-
-
- Override this to listen to events pertaining to the given graphURI.
-
-
-
- void
-removedStatement (java.lang.String serializedTriple,
- java.lang.String graphURI)
-
-
- Override this to listen to all statements removed from the RDF store.
-
-
-
-
-
-
-
-
-
-
-
-addedStatement
-
-void addedStatement (java.lang.String serializedTriple,
- java.lang.String graphURI)
-
-Override this to listen to all statements added to the RDF store.
-
-
-Parameters: serializedTriple
- - the added statement in n3 formatgraphURI
- - the graph to which the statement was added
-
-
-
-
-
-removedStatement
-
-void removedStatement (java.lang.String serializedTriple,
- java.lang.String graphURI)
-
-Override this to listen to all statements removed from the RDF store.
-
-
-Parameters: serializedTriple
- - the removed statement in n3 formatgraphURI
- - the graph from which the statement was removed
-
-
-
-
-
-notifyEvent
-
-void notifyEvent (java.lang.String graphURI,
- java.lang.Object event)
-
-Override this to listen to events pertaining to the given graphURI.
-
-
-Parameters: graphURI
- - the graph to which the event pertainsevent
- - the event that occurred.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeSet.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeSet.html
deleted file mode 100644
index 700f9214a..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ChangeSet.html
+++ /dev/null
@@ -1,486 +0,0 @@
-
-
-
-
-
-
-ChangeSet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Interface ChangeSet
-
-
-public interface ChangeSet
-
-
-
-Input parameter to changeSetUpdate() method in RDFService.
- Represents a precondition query and an ordered list of model changes.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-getPreconditionQuery
-
-java.lang.String getPreconditionQuery ()
-
-
-
-Returns: String - a SPARQL query
-
-
-
-
-
-setPreconditionQuery
-
-void setPreconditionQuery (java.lang.String preconditionQuery)
-
-
-Parameters: preconditionQuery
- - a SPARQL query
-
-
-
-
-
-getPreconditionQueryType
-
-RDFService.SPARQLQueryType getPreconditionQueryType ()
-
-
-
-Returns: RDFService.SPARQLQueryType - the precondition query type
-
-
-
-
-
-setPreconditionQueryType
-
-void setPreconditionQueryType (RDFService.SPARQLQueryType queryType)
-
-
-Parameters: queryType
- - the precondition query type
-
-
-
-
-
-getModelChanges
-
-java.util.List<ModelChange > getModelChanges ()
-
-
-
-Returns: List - list of model changes
-
-
-
-
-
-addAddition
-
-void addAddition (java.io.InputStream model,
- RDFService.ModelSerializationFormat serializationFormat,
- java.lang.String graphURI)
-
-Adds one model change representing an addition to the list of model changes
-
-
-Parameters: model
- - a serialized RDF model (collection of triples)serializationFormat
- - format of the serialized RDF modelgraphURI
- - URI of the graph to which the RDF model should be added
-
-
-
-
-
-addRemoval
-
-void addRemoval (java.io.InputStream model,
- RDFService.ModelSerializationFormat serializationFormat,
- java.lang.String graphURI)
-
-Adds one model change representing a deletion to the list of model changes
-
-
-Parameters: model
- - a serialized RDF model (collection of triples)serializationFormat
- - format of the serialized RDF modelgraphURI
- - URI of the graph from which the RDF model should be removed
-
-
-
-
-
-manufactureModelChange
-
-ModelChange manufactureModelChange ()
-
-Creates an instance of the ModelChange class
-
-
-
-Returns: ModelChange - an empty instance of the ModelChange class
-
-
-
-
-
-manufactureModelChange
-
-ModelChange manufactureModelChange (java.io.InputStream serializedModel,
- RDFService.ModelSerializationFormat serializationFormat,
- ModelChange.Operation operation,
- java.lang.String graphURI)
-
-Creates an instance of the ModelChange class
-
-
-Parameters: serializedModel
- - a serialized RDF model (collection of triples)serializationFormat
- - format of the serialized RDF modeloperation
- - the type of operation to be performed with the serialized RDF modelgraphURI
- - URI of the graph on which to apply the model change operation
-Returns: ModelChange - a ModelChange instance initialized with the input
- model, model format, operation and graphURI
-
-
-
-
-
-addPreChangeEvent
-
-void addPreChangeEvent (java.lang.Object event)
-
-Adds an event that will be be passed to any change listeners in advance of
- the change set additions and retractions being performed. The event
- will only be fired if the precondition (if any) is met.
-
-
-Parameters: event
- - event to notify listeners of in advance of making
- changes to the triple store.
-
-
-
-
-
-addPostChangeEvent
-
-void addPostChangeEvent (java.lang.Object event)
-
-Adds an event that will be be passed to any change listeners after all of
- the change set additions and retractions are performed.
-
-
-Parameters: event
- - the event to notify listeners of after the changes are
- performed.
-
-
-
-
-
-getPreChangeEvents
-
-java.util.List<java.lang.Object> getPreChangeEvents ()
-
-Returns a list of events to pass to any change listeners in
- advance of the change set additions and retractions being performed.
-
-
-
-Returns: List
-
-
-
-
-
-getPostChangeEvents
-
-java.util.List<java.lang.Object> getPostChangeEvents ()
-
-Returns a list of events to pass to any change listeners after
- the change set additions and retractions are performed.
-
-
-
-Returns: List
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ModelChange.Operation.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ModelChange.Operation.html
deleted file mode 100644
index cbf466517..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ModelChange.Operation.html
+++ /dev/null
@@ -1,323 +0,0 @@
-
-
-
-
-
-
-ModelChange.Operation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Enum ModelChange.Operation
-
-java.lang.Object
- java.lang.Enum<ModelChange.Operation >
- edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange.Operation
-
-
-All Implemented Interfaces: java.io.Serializable, java.lang.Comparable<ModelChange.Operation >
-
-
-Enclosing interface: ModelChange
-
-
-
-public static enum ModelChange.Operation extends java.lang.Enum<ModelChange.Operation >
-
-
-
-
-
-
-
-
-
-
-
-
-Enum Constant Summary
-
-
-ADD
-
-
-
-
-
-REMOVE
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
-static ModelChange.Operation
-valueOf (java.lang.String name)
-
-
- Returns the enum constant of this type with the specified name.
-
-
-
-static ModelChange.Operation []
-values ()
-
-
- Returns an array containing the constants of this enum type, in
-the order they are declared.
-
-
-
-
-
-Methods inherited from class java.lang.Enum
-
-
-compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
-
-
-
-
-Methods inherited from class java.lang.Object
-
-
-getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Enum Constant Detail
-
-
-
-
-ADD
-
-public static final ModelChange.Operation ADD
-
-
-
-
-
-
-
-REMOVE
-
-public static final ModelChange.Operation REMOVE
-
-
-
-
-
-
-
-
-
-
-
-values
-
-public static ModelChange.Operation [] values ()
-
-Returns an array containing the constants of this enum type, in
-the order they are declared. This method may be used to iterate
-over the constants as follows:
-
-for (ModelChange.Operation c : ModelChange.Operation.values())
- System.out.println(c);
-
-
-
-
-Returns: an array containing the constants of this enum type, in
-the order they are declared
-
-
-
-
-
-valueOf
-
-public static ModelChange.Operation valueOf (java.lang.String name)
-
-Returns the enum constant of this type with the specified name.
-The string must match exactly an identifier used to declare an
-enum constant in this type. (Extraneous whitespace characters are
-not permitted.)
-
-
-Parameters: name
- the name of the enum constant to be returned.
-Returns: the enum constant with the specified name
- Throws:
-java.lang.IllegalArgumentException
- if this enum type has no constant
-with the specified name
-java.lang.NullPointerException
- if the argument is null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ModelChange.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ModelChange.html
deleted file mode 100644
index 11ca1199d..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/ModelChange.html
+++ /dev/null
@@ -1,368 +0,0 @@
-
-
-
-
-
-
-ModelChange
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Interface ModelChange
-
-
-public interface ModelChange
-
-
-
-A ModelChange is one component of a ChangeSet.
- Represents a model (collection of RDF triples), the URI
- of a graph, and an indication of whether to add or
- remove the model from the graph.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-getSerializedModel
-
-java.io.InputStream getSerializedModel ()
-
-
-
-Returns: InputStream - the serialized model (collection of RDF triples) representing a change to make
-
-
-
-
-
-setSerializedModel
-
-void setSerializedModel (java.io.InputStream serializedModel)
-
-
-Parameters: serializedModel
- - the serialized model (collection of RDF triples) representing a change to make
-
-
-
-
-
-getSerializationFormat
-
-RDFService.ModelSerializationFormat getSerializationFormat ()
-
-
-
-Returns: RDFService.ModelSerializationFormat - the serialization format of the model
-
-
-
-
-
-setSerializationFormat
-
-void setSerializationFormat (RDFService.ModelSerializationFormat serializationFormat)
-
-
-Parameters: serializationFormat
- - the serialization format of the model
-
-
-
-
-
-getOperation
-
-ModelChange.Operation getOperation ()
-
-
-
-Returns: ModelChange.Operation - the operation to be performed
-
-
-
-
-
-setOperation
-
-void setOperation (ModelChange.Operation operation)
-
-
-Parameters: operation
- - the operation to be performed
-
-
-
-
-
-getGraphURI
-
-java.lang.String getGraphURI ()
-
-
-
-Returns: String - the URI of the graph to which to apply the change
-
-
-
-
-
-setGraphURI
-
-void setGraphURI (java.lang.String graphURI)
-
-
-Parameters: graphURI
- - the URI of the graph to which to apply the change
- If the graphURI is null the change applies to the
- default write graph. If this method is not used to
- set the write graph the default write graph will be used.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.ModelSerializationFormat.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.ModelSerializationFormat.html
deleted file mode 100644
index 16c0279e3..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.ModelSerializationFormat.html
+++ /dev/null
@@ -1,323 +0,0 @@
-
-
-
-
-
-
-RDFService.ModelSerializationFormat
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Enum RDFService.ModelSerializationFormat
-
-java.lang.Object
- java.lang.Enum<RDFService.ModelSerializationFormat >
- edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ModelSerializationFormat
-
-
-All Implemented Interfaces: java.io.Serializable, java.lang.Comparable<RDFService.ModelSerializationFormat >
-
-
-Enclosing interface: RDFService
-
-
-
-public static enum RDFService.ModelSerializationFormat extends java.lang.Enum<RDFService.ModelSerializationFormat >
-
-
-
-
-
-
-
-
-
-
-
-
-Enum Constant Summary
-
-
-N3
-
-
-
-
-
-RDFXML
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class java.lang.Enum
-
-
-compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
-
-
-
-
-Methods inherited from class java.lang.Object
-
-
-getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Enum Constant Detail
-
-
-
-
-RDFXML
-
-public static final RDFService.ModelSerializationFormat RDFXML
-
-
-
-
-
-
-
-N3
-
-public static final RDFService.ModelSerializationFormat N3
-
-
-
-
-
-
-
-
-
-
-
-values
-
-public static RDFService.ModelSerializationFormat [] values ()
-
-Returns an array containing the constants of this enum type, in
-the order they are declared. This method may be used to iterate
-over the constants as follows:
-
-for (RDFService.ModelSerializationFormat c : RDFService.ModelSerializationFormat.values())
- System.out.println(c);
-
-
-
-
-Returns: an array containing the constants of this enum type, in
-the order they are declared
-
-
-
-
-
-valueOf
-
-public static RDFService.ModelSerializationFormat valueOf (java.lang.String name)
-
-Returns the enum constant of this type with the specified name.
-The string must match exactly an identifier used to declare an
-enum constant in this type. (Extraneous whitespace characters are
-not permitted.)
-
-
-Parameters: name
- the name of the enum constant to be returned.
-Returns: the enum constant with the specified name
- Throws:
-java.lang.IllegalArgumentException
- if this enum type has no constant
-with the specified name
-java.lang.NullPointerException
- if the argument is null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.ResultFormat.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.ResultFormat.html
deleted file mode 100644
index f737c804e..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.ResultFormat.html
+++ /dev/null
@@ -1,355 +0,0 @@
-
-
-
-
-
-
-RDFService.ResultFormat
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Enum RDFService.ResultFormat
-
-java.lang.Object
- java.lang.Enum<RDFService.ResultFormat >
- edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ResultFormat
-
-
-All Implemented Interfaces: java.io.Serializable, java.lang.Comparable<RDFService.ResultFormat >
-
-
-Enclosing interface: RDFService
-
-
-
-public static enum RDFService.ResultFormat extends java.lang.Enum<RDFService.ResultFormat >
-
-
-
-
-
-
-
-
-
-
-
-
-Enum Constant Summary
-
-
-CSV
-
-
-
-
-
-JSON
-
-
-
-
-
-TEXT
-
-
-
-
-
-XML
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
-static RDFService.ResultFormat
-valueOf (java.lang.String name)
-
-
- Returns the enum constant of this type with the specified name.
-
-
-
-static RDFService.ResultFormat []
-values ()
-
-
- Returns an array containing the constants of this enum type, in
-the order they are declared.
-
-
-
-
-
-Methods inherited from class java.lang.Enum
-
-
-compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
-
-
-
-
-Methods inherited from class java.lang.Object
-
-
-getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Enum Constant Detail
-
-
-
-
-JSON
-
-public static final RDFService.ResultFormat JSON
-
-
-
-
-
-
-
-CSV
-
-public static final RDFService.ResultFormat CSV
-
-
-
-
-
-
-
-XML
-
-public static final RDFService.ResultFormat XML
-
-
-
-
-
-
-
-TEXT
-
-public static final RDFService.ResultFormat TEXT
-
-
-
-
-
-
-
-
-
-
-
-values
-
-public static RDFService.ResultFormat [] values ()
-
-Returns an array containing the constants of this enum type, in
-the order they are declared. This method may be used to iterate
-over the constants as follows:
-
-for (RDFService.ResultFormat c : RDFService.ResultFormat.values())
- System.out.println(c);
-
-
-
-
-Returns: an array containing the constants of this enum type, in
-the order they are declared
-
-
-
-
-
-valueOf
-
-public static RDFService.ResultFormat valueOf (java.lang.String name)
-
-Returns the enum constant of this type with the specified name.
-The string must match exactly an identifier used to declare an
-enum constant in this type. (Extraneous whitespace characters are
-not permitted.)
-
-
-Parameters: name
- the name of the enum constant to be returned.
-Returns: the enum constant with the specified name
- Throws:
-java.lang.IllegalArgumentException
- if this enum type has no constant
-with the specified name
-java.lang.NullPointerException
- if the argument is null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.SPARQLQueryType.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.SPARQLQueryType.html
deleted file mode 100644
index a6e133838..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.SPARQLQueryType.html
+++ /dev/null
@@ -1,355 +0,0 @@
-
-
-
-
-
-
-RDFService.SPARQLQueryType
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Enum RDFService.SPARQLQueryType
-
-java.lang.Object
- java.lang.Enum<RDFService.SPARQLQueryType >
- edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.SPARQLQueryType
-
-
-All Implemented Interfaces: java.io.Serializable, java.lang.Comparable<RDFService.SPARQLQueryType >
-
-
-Enclosing interface: RDFService
-
-
-
-public static enum RDFService.SPARQLQueryType extends java.lang.Enum<RDFService.SPARQLQueryType >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class java.lang.Enum
-
-
-compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
-
-
-
-
-Methods inherited from class java.lang.Object
-
-
-getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Enum Constant Detail
-
-
-
-
-SELECT
-
-public static final RDFService.SPARQLQueryType SELECT
-
-
-
-
-
-
-
-CONSTRUCT
-
-public static final RDFService.SPARQLQueryType CONSTRUCT
-
-
-
-
-
-
-
-DESCRIBE
-
-public static final RDFService.SPARQLQueryType DESCRIBE
-
-
-
-
-
-
-
-ASK
-
-public static final RDFService.SPARQLQueryType ASK
-
-
-
-
-
-
-
-
-
-
-
-values
-
-public static RDFService.SPARQLQueryType [] values ()
-
-Returns an array containing the constants of this enum type, in
-the order they are declared. This method may be used to iterate
-over the constants as follows:
-
-for (RDFService.SPARQLQueryType c : RDFService.SPARQLQueryType.values())
- System.out.println(c);
-
-
-
-
-Returns: an array containing the constants of this enum type, in
-the order they are declared
-
-
-
-
-
-valueOf
-
-public static RDFService.SPARQLQueryType valueOf (java.lang.String name)
-
-Returns the enum constant of this type with the specified name.
-The string must match exactly an identifier used to declare an
-enum constant in this type. (Extraneous whitespace characters are
-not permitted.)
-
-
-Parameters: name
- the name of the enum constant to be returned.
-Returns: the enum constant with the specified name
- Throws:
-java.lang.IllegalArgumentException
- if this enum type has no constant
-with the specified name
-java.lang.NullPointerException
- if the argument is null
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.html
deleted file mode 100644
index d31956c2a..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFService.html
+++ /dev/null
@@ -1,612 +0,0 @@
-
-
-
-
-
-
-RDFService
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Interface RDFService
-
-
-public interface RDFService
-
-
-
-Interface for API to write, read, and update Vitro's RDF store, with support
- to allow listening, logging and auditing.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
- boolean
-changeSetUpdate (ChangeSet changeSet)
-
-
- Performs a series of additions to and or removals from specified graphs
- in the RDF store.
-
-
-
- void
-close ()
-
-
- Frees any resources held by this RDFService object
-
- The implementation of this method should be idempotent so that
- multiple invocations do not cause an error.
-
-
-
- java.lang.String
-getDefaultWriteGraphURI ()
-
-
- Returns the URI of the default write graph
-
-
-
- void
-getGraphMetadata ()
-
-
- To be determined.
-
-
-
- java.util.List<java.lang.String>
-getGraphURIs ()
-
-
- Returns a list of all the graph URIs in the RDF store.
-
-
-
- ChangeSet
-manufactureChangeSet ()
-
-
- Creates a ChangeSet object
-
-
-
- void
-newIndividual (java.lang.String individualURI,
- java.lang.String individualTypeURI)
-
-
- If the given individual already exists in the default write graph, throws an
- RDFServiceException, otherwise adds one type assertion to the default write
- graph.
-
-
-
- void
-newIndividual (java.lang.String individualURI,
- java.lang.String individualTypeURI,
- java.lang.String graphURI)
-
-
- If the given individual already exists in the given graph, throws an
- RDFServiceException, otherwise adds one type assertion to the given
- graph.
-
-
-
- void
-registerListener (ChangeListener changeListener)
-
-
- Registers a listener to listen to changes in any graph in
- the RDF store.
-
-
-
- boolean
-sparqlAskQuery (java.lang.String query)
-
-
- Performs a SPARQL ASK query against the knowledge base.
-
-
-
- java.io.InputStream
-sparqlConstructQuery (java.lang.String query,
- RDFService.ModelSerializationFormat resultFormat)
-
-
- Performs a SPARQL construct query against the knowledge base.
-
-
-
- java.io.InputStream
-sparqlDescribeQuery (java.lang.String query,
- RDFService.ModelSerializationFormat resultFormat)
-
-
- Performs a SPARQL describe query against the knowledge base.
-
-
-
- java.io.InputStream
-sparqlSelectQuery (java.lang.String query,
- RDFService.ResultFormat resultFormat)
-
-
- Performs a SPARQL select query against the knowledge base.
-
-
-
- void
-unregisterListener (ChangeListener changeListener)
-
-
- Unregisters a listener from listening to changes in
- any graph in the RDF store
-
-
-
-
-
-
-
-
-
-
-
-changeSetUpdate
-
-boolean changeSetUpdate (ChangeSet changeSet)
- throws RDFServiceException
-
-Performs a series of additions to and or removals from specified graphs
- in the RDF store. preConditionSparql is executed against the
- union of all the graphs in the knowledge base before any updates are made.
- If the precondition query returns a non-empty result, no updates
- are made made.
-
-
-Parameters: changeSet
- - a set of changes to be performed on the RDF store.
-Returns: boolean - indicates whether the precondition was satisfied
- Throws:
-RDFServiceException
-
-
-
-
-
-newIndividual
-
-void newIndividual (java.lang.String individualURI,
- java.lang.String individualTypeURI)
- throws RDFServiceException
-
-If the given individual already exists in the default write graph, throws an
- RDFServiceException, otherwise adds one type assertion to the default write
- graph.
-
-
-Parameters: individualURI
- - URI of the individual to be addedindividualTypeURI
- - URI of the type for the individual
-Throws:
-RDFServiceException
-
-
-
-
-
-newIndividual
-
-void newIndividual (java.lang.String individualURI,
- java.lang.String individualTypeURI,
- java.lang.String graphURI)
- throws RDFServiceException
-
-If the given individual already exists in the given graph, throws an
- RDFServiceException, otherwise adds one type assertion to the given
- graph.
-
-
-Parameters: individualURI
- - URI of the individual to be addedindividualTypeURI
- - URI of the type for the individualgraphURI
- - URI of the graph to which to add the individual
-Throws:
-RDFServiceException
-
-
-
-
-
-sparqlConstructQuery
-
-java.io.InputStream sparqlConstructQuery (java.lang.String query,
- RDFService.ModelSerializationFormat resultFormat)
- throws RDFServiceException
-
-Performs a SPARQL construct query against the knowledge base. The query may have
- an embedded graph identifier. If the query does not contain a graph identifier
- the query is executed against the union of all named and unnamed graphs in the
- store.
-
-
-Parameters: query
- - the SPARQL query to be executed against the RDF storeresultFormat
- - type of serialization for RDF result of the SPARQL query
-Returns: InputStream - the result of the query
- Throws:
-RDFServiceException
-
-
-
-
-
-sparqlDescribeQuery
-
-java.io.InputStream sparqlDescribeQuery (java.lang.String query,
- RDFService.ModelSerializationFormat resultFormat)
- throws RDFServiceException
-
-Performs a SPARQL describe query against the knowledge base. The query may have
- an embedded graph identifier. If the query does not contain a graph identifier
- the query is executed against the union of all named and unnamed graphs in the
- store.
-
-
-Parameters: query
- - the SPARQL query to be executed against the RDF storeresultFormat
- - type of serialization for RDF result of the SPARQL query
-Returns: InputStream - the result of the query
- Throws:
-RDFServiceException
-
-
-
-
-
-sparqlSelectQuery
-
-java.io.InputStream sparqlSelectQuery (java.lang.String query,
- RDFService.ResultFormat resultFormat)
- throws RDFServiceException
-
-Performs a SPARQL select query against the knowledge base. The query may have
- an embedded graph identifier. If the query does not contain a graph identifier
- the query is executed against the union of all named and unnamed graphs in the
- store.
-
-
-Parameters: query
- - the SPARQL query to be executed against the RDF storeresultFormat
- - format for the result of the Select query
-Returns: InputStream - the result of the query
- Throws:
-RDFServiceException
-
-
-
-
-
-sparqlAskQuery
-
-boolean sparqlAskQuery (java.lang.String query)
- throws RDFServiceException
-
-Performs a SPARQL ASK query against the knowledge base. The query may have
- an embedded graph identifier. If the query does not contain a graph identifier
- the query is executed against the union of all named and unnamed graphs in the
- store.
-
-
-Parameters: query
- - the SPARQL ASK query to be executed against the RDF store
-Returns: boolean - the result of the SPARQL ASK query
- Throws:
-RDFServiceException
-
-
-
-
-
-getGraphURIs
-
-java.util.List<java.lang.String> getGraphURIs ()
- throws RDFServiceException
-
-Returns a list of all the graph URIs in the RDF store.
-
-
-
-Returns: List - list of all the named graph URIs in the RDF store.
- Return an empty list of there no named graphs in
- the store.
-Throws:
-RDFServiceException
-
-
-
-
-
-getGraphMetadata
-
-void getGraphMetadata ()
- throws RDFServiceException
-
-To be determined. This is a place holder and is not implemented
- in current implementations.
-
-
-
-Throws:
-RDFServiceException
-
-
-
-
-
-getDefaultWriteGraphURI
-
-java.lang.String getDefaultWriteGraphURI ()
- throws RDFServiceException
-
-Returns the URI of the default write graph
-
-
-
-Returns: String URI of default write graph. Returns null if no
- default write graph has been set.
- Throws:
-RDFServiceException
-
-
-
-
-
-registerListener
-
-void registerListener (ChangeListener changeListener)
- throws RDFServiceException
-
-Registers a listener to listen to changes in any graph in
- the RDF store.
-
-
-Parameters: changeListener
- - the change listener
-Throws:
-RDFServiceException
-
-
-
-
-
-unregisterListener
-
-void unregisterListener (ChangeListener changeListener)
- throws RDFServiceException
-
-Unregisters a listener from listening to changes in
- any graph in the RDF store
-
-
-Parameters: changeListener
- - the change listener
-Throws:
-RDFServiceException
-
-
-
-
-
-manufactureChangeSet
-
-ChangeSet manufactureChangeSet ()
-
-Creates a ChangeSet object
-
-
-
-Returns: ChangeSet an empty ChangeSet object
-
-
-
-
-
-close
-
-void close ()
-
-Frees any resources held by this RDFService object
-
- The implementation of this method should be idempotent so that
- multiple invocations do not cause an error.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFServiceException.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFServiceException.html
deleted file mode 100644
index de5c69d69..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFServiceException.html
+++ /dev/null
@@ -1,282 +0,0 @@
-
-
-
-
-
-
-RDFServiceException
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Class RDFServiceException
-
-java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException
-
-
-All Implemented Interfaces: java.io.Serializable
-
-
-
-public class RDFServiceException extends java.lang.Exception
-
-
-
-
-See Also: Serialized Form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class java.lang.Throwable
-
-
-fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
-
-Methods inherited from class java.lang.Object
-
-
-equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Constructor Detail
-
-
-
-
-RDFServiceException
-
-public RDFServiceException ()
-
-
-
-
-
-RDFServiceException
-
-public RDFServiceException (java.lang.Throwable cause)
-
-
-
-
-
-RDFServiceException
-
-public RDFServiceException (java.lang.String message)
-
-
-
-
-
-RDFServiceException
-
-public RDFServiceException (java.lang.String message,
- java.lang.Throwable cause)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFServiceFactory.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFServiceFactory.html
deleted file mode 100644
index 4e4a3a7fe..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/RDFServiceFactory.html
+++ /dev/null
@@ -1,258 +0,0 @@
-
-
-
-
-
-
-RDFServiceFactory
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-Interface RDFServiceFactory
-
-
-public interface RDFServiceFactory
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-getRDFService
-
-RDFService getRDFService ()
-
-
-
-Returns: RDFService - an RDFService instance
-
-
-
-
-
-registerListener
-
-void registerListener (ChangeListener changeListener)
- throws RDFServiceException
-
-Registers a listener to listen to changes in any graph in
- the RDF store. Any RDFService objects returned by this factory
- should notify this listener of changes.
-
-
-Parameters: changeListener
- - the change listener
-Throws:
-RDFServiceException
-
-
-
-
-
-unregisterListener
-
-void unregisterListener (ChangeListener changeListener)
- throws RDFServiceException
-
-Unregisters a listener from listening to changes in the RDF store.
- Any RDFService objects returned by this factory should notify
- this listener of changes.
-
-
-Parameters: changeListener
- - the change listener
-Throws:
-RDFServiceException
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ChangeListener.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ChangeListener.html
deleted file mode 100644
index be0611e0c..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ChangeListener.html
+++ /dev/null
@@ -1,192 +0,0 @@
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeListener
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeListener
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ChangeSet.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ChangeSet.html
deleted file mode 100644
index 394d27c0c..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ChangeSet.html
+++ /dev/null
@@ -1,182 +0,0 @@
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ModelChange.Operation.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ModelChange.Operation.html
deleted file mode 100644
index 2141771a8..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ModelChange.Operation.html
+++ /dev/null
@@ -1,209 +0,0 @@
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange.Operation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange.Operation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ModelChange.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ModelChange.html
deleted file mode 100644
index 9b80c8735..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/ModelChange.html
+++ /dev/null
@@ -1,192 +0,0 @@
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.ModelSerializationFormat.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.ModelSerializationFormat.html
deleted file mode 100644
index cf0b0851a..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.ModelSerializationFormat.html
+++ /dev/null
@@ -1,247 +0,0 @@
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ModelSerializationFormat
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ModelSerializationFormat
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.ResultFormat.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.ResultFormat.html
deleted file mode 100644
index 5cf53a9aa..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.ResultFormat.html
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ResultFormat
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ResultFormat
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.SPARQLQueryType.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.SPARQLQueryType.html
deleted file mode 100644
index c8266bceb..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.SPARQLQueryType.html
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.SPARQLQueryType
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.SPARQLQueryType
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.html
deleted file mode 100644
index 6afde2d3f..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFService.html
+++ /dev/null
@@ -1,165 +0,0 @@
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFServiceException.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFServiceException.html
deleted file mode 100644
index 0919aee71..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFServiceException.html
+++ /dev/null
@@ -1,283 +0,0 @@
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException
-
-
-
-
-
-
-
-
-Methods in edu.cornell.mannlib.vitro.webapp.rdfservice that throw RDFServiceException
-
-
-
- boolean
-RDFService. changeSetUpdate (ChangeSet changeSet)
-
-
- Performs a series of additions to and or removals from specified graphs
- in the RDF store.
-
-
-
- java.lang.String
-RDFService. getDefaultWriteGraphURI ()
-
-
- Returns the URI of the default write graph
-
-
-
- void
-RDFService. getGraphMetadata ()
-
-
- To be determined.
-
-
-
- java.util.List<java.lang.String>
-RDFService. getGraphURIs ()
-
-
- Returns a list of all the graph URIs in the RDF store.
-
-
-
- void
-RDFService. newIndividual (java.lang.String individualURI,
- java.lang.String individualTypeURI)
-
-
- If the given individual already exists in the default write graph, throws an
- RDFServiceException, otherwise adds one type assertion to the default write
- graph.
-
-
-
- void
-RDFService. newIndividual (java.lang.String individualURI,
- java.lang.String individualTypeURI,
- java.lang.String graphURI)
-
-
- If the given individual already exists in the given graph, throws an
- RDFServiceException, otherwise adds one type assertion to the given
- graph.
-
-
-
- void
-RDFServiceFactory. registerListener (ChangeListener changeListener)
-
-
- Registers a listener to listen to changes in any graph in
- the RDF store.
-
-
-
- void
-RDFService. registerListener (ChangeListener changeListener)
-
-
- Registers a listener to listen to changes in any graph in
- the RDF store.
-
-
-
- boolean
-RDFService. sparqlAskQuery (java.lang.String query)
-
-
- Performs a SPARQL ASK query against the knowledge base.
-
-
-
- java.io.InputStream
-RDFService. sparqlConstructQuery (java.lang.String query,
- RDFService.ModelSerializationFormat resultFormat)
-
-
- Performs a SPARQL construct query against the knowledge base.
-
-
-
- java.io.InputStream
-RDFService. sparqlDescribeQuery (java.lang.String query,
- RDFService.ModelSerializationFormat resultFormat)
-
-
- Performs a SPARQL describe query against the knowledge base.
-
-
-
- java.io.InputStream
-RDFService. sparqlSelectQuery (java.lang.String query,
- RDFService.ResultFormat resultFormat)
-
-
- Performs a SPARQL select query against the knowledge base.
-
-
-
- void
-RDFServiceFactory. unregisterListener (ChangeListener changeListener)
-
-
- Unregisters a listener from listening to changes in the RDF store.
-
-
-
- void
-RDFService. unregisterListener (ChangeListener changeListener)
-
-
- Unregisters a listener from listening to changes in
- any graph in the RDF store
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFServiceFactory.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFServiceFactory.html
deleted file mode 100644
index 0c4d673a1..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/class-use/RDFServiceFactory.html
+++ /dev/null
@@ -1,142 +0,0 @@
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory
-
-No usage of edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-frame.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-frame.html
deleted file mode 100644
index 3b425ee22..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-frame.html
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-
-
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-summary.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-summary.html
deleted file mode 100644
index 30fc3c716..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-summary.html
+++ /dev/null
@@ -1,213 +0,0 @@
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Package edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-
-
-Interface Summary
-
-
-ChangeListener
-An interface for listening to triples that are added to or removed
- from the triple store, and other miscellaneous events.
-
-
-ChangeSet
-Input parameter to changeSetUpdate() method in RDFService.
-
-
-ModelChange
-A ModelChange is one component of a ChangeSet.
-
-
-RDFService
-Interface for API to write, read, and update Vitro's RDF store, with support
- to allow listening, logging and auditing.
-
-
-RDFServiceFactory
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-tree.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-tree.html
deleted file mode 100644
index b2aff9e48..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-tree.html
+++ /dev/null
@@ -1,168 +0,0 @@
-
-
-
-
-
-
-edu.cornell.mannlib.vitro.webapp.rdfservice Class Hierarchy
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Hierarchy For Package edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-Class Hierarchy
-
-
-java.lang.Object
-java.lang.Throwable (implements java.io.Serializable)
-
-
-
-
-Interface Hierarchy
-
-
-
-Enum Hierarchy
-
-
-java.lang.Object
-java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-use.html b/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-use.html
deleted file mode 100644
index 3123be0c4..000000000
--- a/doc/RDFService/edu/cornell/mannlib/vitro/webapp/rdfservice/package-use.html
+++ /dev/null
@@ -1,205 +0,0 @@
-
-
-
-
-
-
-Uses of Package edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Package edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/help-doc.html b/doc/RDFService/help-doc.html
deleted file mode 100644
index cb70678ff..000000000
--- a/doc/RDFService/help-doc.html
+++ /dev/null
@@ -1,215 +0,0 @@
-
-
-
-
-
-
-API Help
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-How This API Document Is Organized
-
-This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
-Package
-
-
-
-Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:
-Interfaces (italic) Classes Enums Exceptions Errors Annotation Types
-
-
-Class/Interface
-
-
-
-Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
-Class inheritance diagram Direct Subclasses All Known Subinterfaces All Known Implementing Classes Class/interface declaration Class/interface description
-
-
Nested Class Summary Field Summary Constructor Summary Method Summary
-
-
Field Detail Constructor Detail Method Detail
-Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
-
-
-Annotation Type
-
-
-
-Each annotation type has its own separate page with the following sections:
-Annotation Type declaration Annotation Type description Required Element Summary Optional Element Summary Element Detail
-
-
-
-Enum
-
-
-
-Each enum has its own separate page with the following sections:
-Enum declaration Enum description Enum Constant Summary Enum Constant Detail
-
-
-Use
-
-Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
-
-Tree (Class Hierarchy)
-
-There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
-When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages. When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
-
-
-Deprecated API
-
-The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
-
-Index
-
-The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-
-Prev/Next
-These links take you to the next or previous class, interface, package, or related page.
-Frames/No Frames
-These links show and hide the HTML frames. All pages are available with or without frames.
-
-
-Serialized Form
-Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
-
-
-Constant Field Values
-The Constant Field Values page lists the static final fields and their values.
-
-
-
-This help file applies to API documentation generated using the standard doclet.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/index-files/index-1.html b/doc/RDFService/index-files/index-1.html
deleted file mode 100644
index b33d29aa7..000000000
--- a/doc/RDFService/index-files/index-1.html
+++ /dev/null
@@ -1,157 +0,0 @@
-
-
-
-
-
-
-A-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-A
-
-addAddition(InputStream, RDFService.ModelSerializationFormat, String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-Adds one model change representing an addition to the list of model changes
- addedStatement(String, String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeListener
-Override this to listen to all statements added to the RDF store.
- addPostChangeEvent(Object) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-Adds an event that will be be passed to any change listeners after all of
- the change set additions and retractions are performed.
- addPreChangeEvent(Object) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-Adds an event that will be be passed to any change listeners in advance of
- the change set additions and retractions being performed.
- addRemoval(InputStream, RDFService.ModelSerializationFormat, String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-Adds one model change representing a deletion to the list of model changes
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index-files/index-10.html b/doc/RDFService/index-files/index-10.html
deleted file mode 100644
index c581a968a..000000000
--- a/doc/RDFService/index-files/index-10.html
+++ /dev/null
@@ -1,168 +0,0 @@
-
-
-
-
-
-
-V-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-V
-
-valueOf(String) -
-Static method in enum edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange.Operation
-Returns the enum constant of this type with the specified name.
- valueOf(String) -
-Static method in enum edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ModelSerializationFormat
-Returns the enum constant of this type with the specified name.
- valueOf(String) -
-Static method in enum edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ResultFormat
-Returns the enum constant of this type with the specified name.
- valueOf(String) -
-Static method in enum edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.SPARQLQueryType
-Returns the enum constant of this type with the specified name.
- values() -
-Static method in enum edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange.Operation
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- values() -
-Static method in enum edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ModelSerializationFormat
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- values() -
-Static method in enum edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.ResultFormat
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- values() -
-Static method in enum edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService.SPARQLQueryType
-Returns an array containing the constants of this enum type, in
-the order they are declared.
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index-files/index-2.html b/doc/RDFService/index-files/index-2.html
deleted file mode 100644
index fe5578a20..000000000
--- a/doc/RDFService/index-files/index-2.html
+++ /dev/null
@@ -1,151 +0,0 @@
-
-
-
-
-
-
-C-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-C
-
-ChangeListener - Interface in edu.cornell.mannlib.vitro.webapp.rdfservice An interface for listening to triples that are added to or removed
- from the triple store, and other miscellaneous events. ChangeSet - Interface in edu.cornell.mannlib.vitro.webapp.rdfservice Input parameter to changeSetUpdate() method in RDFService. changeSetUpdate(ChangeSet) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Performs a series of additions to and or removals from specified graphs
- in the RDF store.
- close() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Frees any resources held by this RDFService object
-
- The implementation of this method should be idempotent so that
- multiple invocations do not cause an error.
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index-files/index-3.html b/doc/RDFService/index-files/index-3.html
deleted file mode 100644
index b684f3927..000000000
--- a/doc/RDFService/index-files/index-3.html
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
-
-E-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-E
-
-edu.cornell.mannlib.vitro.webapp.rdfservice - package edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index-files/index-4.html b/doc/RDFService/index-files/index-4.html
deleted file mode 100644
index 76be056e5..000000000
--- a/doc/RDFService/index-files/index-4.html
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-
-
-
-
-G-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-G
-
-getDefaultWriteGraphURI() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Returns the URI of the default write graph
- getGraphMetadata() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-To be determined.
- getGraphURI() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
- getGraphURIs() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Returns a list of all the graph URIs in the RDF store.
- getModelChanges() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-
- getOperation() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
- getPostChangeEvents() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-Returns a list of events to pass to any change listeners after
- the change set additions and retractions are performed.
- getPreChangeEvents() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-Returns a list of events to pass to any change listeners in
- advance of the change set additions and retractions being performed.
- getPreconditionQuery() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-
- getPreconditionQueryType() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-
- getRDFService() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory
-
- getSerializationFormat() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
- getSerializedModel() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index-files/index-5.html b/doc/RDFService/index-files/index-5.html
deleted file mode 100644
index b54b95399..000000000
--- a/doc/RDFService/index-files/index-5.html
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-
-
-
-
-M-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-M
-
-manufactureChangeSet() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Creates a ChangeSet object
- manufactureModelChange() -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-Creates an instance of the ModelChange class
- manufactureModelChange(InputStream, RDFService.ModelSerializationFormat, ModelChange.Operation, String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-Creates an instance of the ModelChange class
- ModelChange - Interface in edu.cornell.mannlib.vitro.webapp.rdfservice A ModelChange is one component of a ChangeSet. ModelChange.Operation - Enum in edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index-files/index-6.html b/doc/RDFService/index-files/index-6.html
deleted file mode 100644
index 726493019..000000000
--- a/doc/RDFService/index-files/index-6.html
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
-
-
-N-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-N
-
-newIndividual(String, String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-If the given individual already exists in the default write graph, throws an
- RDFServiceException, otherwise adds one type assertion to the default write
- graph.
- newIndividual(String, String, String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-If the given individual already exists in the given graph, throws an
- RDFServiceException, otherwise adds one type assertion to the given
- graph.
- notifyEvent(String, Object) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeListener
-Override this to listen to events pertaining to the given graphURI.
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index-files/index-7.html b/doc/RDFService/index-files/index-7.html
deleted file mode 100644
index b760f0816..000000000
--- a/doc/RDFService/index-files/index-7.html
+++ /dev/null
@@ -1,164 +0,0 @@
-
-
-
-
-
-
-R-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-R
-
-RDFService - Interface in edu.cornell.mannlib.vitro.webapp.rdfservice Interface for API to write, read, and update Vitro's RDF store, with support
- to allow listening, logging and auditing. RDFService.ModelSerializationFormat - Enum in edu.cornell.mannlib.vitro.webapp.rdfservice RDFService.ResultFormat - Enum in edu.cornell.mannlib.vitro.webapp.rdfservice RDFService.SPARQLQueryType - Enum in edu.cornell.mannlib.vitro.webapp.rdfservice RDFServiceException - Exception in edu.cornell.mannlib.vitro.webapp.rdfservice RDFServiceException() -
-Constructor for exception edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException
-
- RDFServiceException(Throwable) -
-Constructor for exception edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException
-
- RDFServiceException(String) -
-Constructor for exception edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException
-
- RDFServiceException(String, Throwable) -
-Constructor for exception edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException
-
- RDFServiceFactory - Interface in edu.cornell.mannlib.vitro.webapp.rdfservice registerListener(ChangeListener) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Registers a listener to listen to changes in any graph in
- the RDF store.
- registerListener(ChangeListener) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory
-Registers a listener to listen to changes in any graph in
- the RDF store.
- removedStatement(String, String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeListener
-Override this to listen to all statements removed from the RDF store.
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index-files/index-8.html b/doc/RDFService/index-files/index-8.html
deleted file mode 100644
index 61f2e7961..000000000
--- a/doc/RDFService/index-files/index-8.html
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
-
-
-S-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-S
-
-setGraphURI(String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
- setOperation(ModelChange.Operation) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
- setPreconditionQuery(String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-
- setPreconditionQueryType(RDFService.SPARQLQueryType) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ChangeSet
-
- setSerializationFormat(RDFService.ModelSerializationFormat) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
- setSerializedModel(InputStream) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.ModelChange
-
- sparqlAskQuery(String) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Performs a SPARQL ASK query against the knowledge base.
- sparqlConstructQuery(String, RDFService.ModelSerializationFormat) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Performs a SPARQL construct query against the knowledge base.
- sparqlDescribeQuery(String, RDFService.ModelSerializationFormat) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Performs a SPARQL describe query against the knowledge base.
- sparqlSelectQuery(String, RDFService.ResultFormat) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Performs a SPARQL select query against the knowledge base.
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index-files/index-9.html b/doc/RDFService/index-files/index-9.html
deleted file mode 100644
index ffe61727e..000000000
--- a/doc/RDFService/index-files/index-9.html
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
-
-
-
-
-U-Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-U
-
-unregisterListener(ChangeListener) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
-Unregisters a listener from listening to changes in
- any graph in the RDF store
- unregisterListener(ChangeListener) -
-Method in interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory
-Unregisters a listener from listening to changes in the RDF store.
-
-
-
-
-
-
-
-
-
-
-
-A C E G M N R S U V
-
-
-
diff --git a/doc/RDFService/index.html b/doc/RDFService/index.html
deleted file mode 100644
index 614d8e8d7..000000000
--- a/doc/RDFService/index.html
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-Generated Documentation (Untitled)
-
-
-
-
-
-
-
-
-
-
-Frame Alert
-
-
-This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
-
-Link toNon-frame version.
-
-
-
diff --git a/doc/RDFService/overview-tree.html b/doc/RDFService/overview-tree.html
deleted file mode 100644
index 4f6fa7bc1..000000000
--- a/doc/RDFService/overview-tree.html
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
-
-
-Class Hierarchy
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Hierarchy For All Packages
-
-
-Package Hierarchies: edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-Class Hierarchy
-
-
-java.lang.Object
-java.lang.Throwable (implements java.io.Serializable)
-
-
-
-
-Interface Hierarchy
-
-
-
-Enum Hierarchy
-
-
-java.lang.Object
-java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/package-list b/doc/RDFService/package-list
deleted file mode 100644
index eca5affca..000000000
--- a/doc/RDFService/package-list
+++ /dev/null
@@ -1 +0,0 @@
-edu.cornell.mannlib.vitro.webapp.rdfservice
diff --git a/doc/RDFService/resources/inherit.gif b/doc/RDFService/resources/inherit.gif
deleted file mode 100644
index c814867a1..000000000
Binary files a/doc/RDFService/resources/inherit.gif and /dev/null differ
diff --git a/doc/RDFService/serialized-form.html b/doc/RDFService/serialized-form.html
deleted file mode 100644
index be86744b5..000000000
--- a/doc/RDFService/serialized-form.html
+++ /dev/null
@@ -1,161 +0,0 @@
-
-
-
-
-
-
-Serialized Form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Serialized Form
-
-
-
-
-
-
-Package edu.cornell.mannlib.vitro.webapp.rdfservice
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/RDFService/stylesheet.css b/doc/RDFService/stylesheet.css
deleted file mode 100644
index 7e877986b..000000000
--- a/doc/RDFService/stylesheet.css
+++ /dev/null
@@ -1,30 +0,0 @@
-/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-/* Javadoc style sheet */
-
-/* Define colors, fonts and other style attributes here to override the defaults */
-
-/* Page background color */
-body { background-color: #FFFFFF; color:#000000 }
-
-/* Headings */
-h1 { font-size: 145% }
-
-/* Table colors */
-.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */
-.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */
-.TableRowColor { background: #FFFFFF; color:#000000 } /* White */
-
-/* Font used in left-hand frame lists */
-.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
-.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
-.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
-
-/* Navigation bar fonts and colors */
-.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */
-.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */
-.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}
-.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}
-
-.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
-.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
-
diff --git a/webapp/build.xml b/webapp/build.xml
index f62e2d8dd..543ecf0c4 100644
--- a/webapp/build.xml
+++ b/webapp/build.xml
@@ -269,6 +269,12 @@
+
+
+
+
+
+
diff --git a/webapp/languages/es_GO/i18n/all_es_GO.properties b/webapp/languages/es_GO/i18n/all_es_GO.properties
index 0b9247a61..fb56a2344 100644
--- a/webapp/languages/es_GO/i18n/all_es_GO.properties
+++ b/webapp/languages/es_GO/i18n/all_es_GO.properties
@@ -859,6 +859,7 @@ local_name = Nombre local
group_capitalized = Grupo
domain_class = Clase de dominio
range_class = Clase Rango
+range_data_type = Tipo de datos de gama
sub_properties = Subpropiedades
subproperty = subpropiedad
diff --git a/webapp/rdf/display/everytime/SearchIndexerConfiguration.n3 b/webapp/rdf/display/everytime/SearchIndexerConfiguration.n3
new file mode 100644
index 000000000..fb82c5b74
--- /dev/null
+++ b/webapp/rdf/display/everytime/SearchIndexerConfiguration.n3
@@ -0,0 +1,57 @@
+@prefix : .
+@prefix xsd: .
+
+#
+# Specify the SearchIndexExcluders and DocumentModifiers.
+#
+
+# Exclude from the search index Individuals with types from these namespaces.
+# Note: if you do OWL.NS here you will exclude all of owl:Thing.
+:searchExcluder_namespaceExcluder
+ a ,
+ ;
+ :excludes
+ "http://vitro.mannlib.cornell.edu/ns/vitro/0.7#" ,
+ "http://vitro.mannlib.cornell.edu/ns/vitro/public#" ,
+ "http://vitro.mannlib.cornell.edu/ns/bnode#" ,
+ "http://www.w3.org/2002/07/owl#" .
+
+# Individuals of these types will be excluded from the search index
+:searchExcluder_typeExcluder
+ a ,
+ ;
+ :excludes
+ "http://www.w3.org/2002/07/owl#AnnotationProperty" ,
+ "http://www.w3.org/2002/07/owl#DatatypeProperty" ,
+ "http://www.w3.org/2002/07/owl#ObjectProperty" .
+
+# Exclude from the search index individuals who's URIs start with these namespaces.
+:searchExcluder_typeNamespaceExcluder
+ a ,
+ ;
+ :excludes
+ "http://vitro.mannlib.cornell.edu/ns/vitro/role#public" .
+
+:searchExcluder_vitroExcluder
+ a ,
+ .
+
+:searchExcluder_syncingTypeExcluder
+ a ,
+ .
+
+# ------------------------------------
+
+:documentModifier_nameFields
+ a ,
+ .
+
+:documentModifier_nameBoost
+ a ,
+ ;
+ :hasBoost "1.2"^^xsd:float .
+
+:documentModifier_thumbnailImageUrl
+ a ,
+ .
+
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationImpl.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationImpl.java
index 6ecdf18f7..544340e00 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationImpl.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationImpl.java
@@ -2,21 +2,28 @@
package edu.cornell.mannlib.vitro.webapp.application;
+import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONFIGURATION;
+
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
-import edu.cornell.mannlib.vitro.webapp.filestorage.impl.FileStorageImplWrapper;
-import edu.cornell.mannlib.vitro.webapp.imageprocessor.jai.JaiImageProcessor;
+import com.hp.hpl.jena.ontology.OntDocumentManager;
+
+import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
import edu.cornell.mannlib.vitro.webapp.modules.Application;
import edu.cornell.mannlib.vitro.webapp.modules.ComponentStartupStatus;
import edu.cornell.mannlib.vitro.webapp.modules.fileStorage.FileStorage;
import edu.cornell.mannlib.vitro.webapp.modules.imageProcessor.ImageProcessor;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngine;
-import edu.cornell.mannlib.vitro.webapp.searchengine.InstrumentedSearchEngineWrapper;
-import edu.cornell.mannlib.vitro.webapp.searchengine.solr.SolrSearchEngine;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ConfigurationTripleSource;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ContentTripleSource;
+import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils;
+import edu.cornell.mannlib.vitro.webapp.triplesource.impl.BasicCombinedTripleSource;
import edu.cornell.mannlib.vitro.webapp.startup.ComponentStartupStatusImpl;
import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Property;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Validation;
/**
* The basic implementation of the Application interface.
@@ -26,12 +33,16 @@ public class ApplicationImpl implements Application {
// The instance
// ----------------------------------------------------------------------
- private final ServletContext ctx;
+ private ServletContext ctx;
+ private VitroHomeDirectory homeDirectory;
+
private SearchEngine searchEngine;
private ImageProcessor imageProcessor;
private FileStorage fileStorage;
+ private ContentTripleSource contentTripleSource;
+ private ConfigurationTripleSource configurationTripleSource;
- public ApplicationImpl(ServletContext ctx) {
+ public void setServletContext(ServletContext ctx) {
this.ctx = ctx;
}
@@ -40,13 +51,29 @@ public class ApplicationImpl implements Application {
return ctx;
}
+ @Override
+ public VitroHomeDirectory getHomeDirectory() {
+ return homeDirectory;
+ }
+
+ public void setHomeDirectory(VitroHomeDirectory homeDirectory) {
+ this.homeDirectory = homeDirectory;
+ }
+
@Override
public SearchEngine getSearchEngine() {
return searchEngine;
}
- public void setSearchEngine(SearchEngine searchEngine) {
- this.searchEngine = searchEngine;
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasSearchEngine")
+ public void setSearchEngine(SearchEngine se) {
+ if (searchEngine == null) {
+ searchEngine = se;
+ } else {
+ throw new IllegalStateException(
+ "Configuration includes multiple SearchEngine instancess: "
+ + searchEngine + ", and " + se);
+ }
}
@Override
@@ -54,8 +81,15 @@ public class ApplicationImpl implements Application {
return imageProcessor;
}
- public void setImageProcessor(ImageProcessor imageProcessor) {
- this.imageProcessor = imageProcessor;
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasImageProcessor")
+ public void setImageProcessor(ImageProcessor ip) {
+ if (imageProcessor == null) {
+ imageProcessor = ip;
+ } else {
+ throw new IllegalStateException(
+ "Configuration includes multiple ImageProcessor instancess: "
+ + imageProcessor + ", and " + ip);
+ }
}
@Override
@@ -63,57 +97,151 @@ public class ApplicationImpl implements Application {
return fileStorage;
}
- public void setFileStorage(FileStorage fileStorage) {
- this.fileStorage = fileStorage;
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasFileStorage")
+ public void setFileStorage(FileStorage fs) {
+ if (fileStorage == null) {
+ fileStorage = fs;
+ } else {
+ throw new IllegalStateException(
+ "Configuration includes multiple FileStorage intances: "
+ + fileStorage + ", and " + fs);
+ }
+ }
+
+ @Override
+ public ContentTripleSource getContentTripleSource() {
+ return contentTripleSource;
+ }
+
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasContentTripleSource")
+ public void setContentTripleSource(ContentTripleSource source) {
+ if (contentTripleSource == null) {
+ contentTripleSource = source;
+ } else {
+ throw new IllegalStateException(
+ "Configuration includes multiple intances of ContentTripleSource: "
+ + contentTripleSource + ", and " + source);
+ }
+ }
+
+ @Override
+ public ConfigurationTripleSource getConfigurationTripleSource() {
+ return configurationTripleSource;
+ }
+
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasConfigurationTripleSource")
+ public void setConfigurationTripleSource(ConfigurationTripleSource source) {
+ if (configurationTripleSource == null) {
+ configurationTripleSource = source;
+ } else {
+ throw new IllegalStateException(
+ "Configuration includes multiple intances of ConfigurationTripleSource: "
+ + configurationTripleSource + ", and " + source);
+ }
+ }
+
+ @Validation
+ public void validate() throws Exception {
+ if (searchEngine == null) {
+ throw new IllegalStateException(
+ "Configuration did not include a SearchEngine.");
+ }
+ if (imageProcessor == null) {
+ throw new IllegalStateException(
+ "Configuration did not include an ImageProcessor.");
+ }
+ if (fileStorage == null) {
+ throw new IllegalStateException(
+ "Configuration did not include a FileStorage.");
+ }
+ if (contentTripleSource == null) {
+ throw new IllegalStateException(
+ "Configuration did not include a ContentTripleSource.");
+ }
+ if (configurationTripleSource == null) {
+ throw new IllegalStateException(
+ "Configuration did not include a ConfigurationTripleSource.");
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ getFileStorage().shutdown(this);
+ getImageProcessor().shutdown(this);
+ getSearchEngine().shutdown(this);
}
// ----------------------------------------------------------------------
- // The Setup class.
+ // Setup the major components.
+ //
+ // This must happen after the ConfigurationProperties and some other stuff.
// ----------------------------------------------------------------------
- public static class Setup implements ServletContextListener {
- private ApplicationImpl application;
-
+ public static class ComponentsSetup implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
ServletContext ctx = sce.getServletContext();
+ Application app = ApplicationUtils.instance();
StartupStatus ss = StartupStatus.getBean(ctx);
+ ComponentStartupStatus css = new ComponentStartupStatusImpl(this,
+ ss);
- try {
- application = new ApplicationImpl(ctx);
-
- ComponentStartupStatus css = new ComponentStartupStatusImpl(
- this, ss);
+ SearchEngine searchEngine = app.getSearchEngine();
+ searchEngine.startup(app, css);
+ ss.info(this, "Started the SearchEngine: " + searchEngine);
- SearchEngine searchEngine = new InstrumentedSearchEngineWrapper(
- new SolrSearchEngine());
- searchEngine.startup(application, css);
- application.setSearchEngine(searchEngine);
- ss.info(this, "Started the searchEngine: " + searchEngine);
+ ImageProcessor imageProcessor = app.getImageProcessor();
+ imageProcessor.startup(app, css);
+ ss.info(this, "Started the ImageProcessor: " + imageProcessor);
- ImageProcessor imageProcessor = new JaiImageProcessor();
- imageProcessor.startup(application, css);
- application.setImageProcessor(imageProcessor);
- ss.info(this, "Started the ImageProcessor: " + searchEngine);
+ FileStorage fileStorage = app.getFileStorage();
+ fileStorage.startup(app, css);
+ ss.info(this, "Started the FileStorage system: " + fileStorage);
- FileStorage fileStorage = new FileStorageImplWrapper();
- fileStorage.startup(application, css);
- application.setFileStorage(fileStorage);
- ss.info(this, "Started the FileStorage system: " + searchEngine);
+ ContentTripleSource contentTripleSource = app
+ .getContentTripleSource();
+ contentTripleSource.startup(app, css);
+ ss.info(this, "Started the ContentTripleSource: "
+ + contentTripleSource);
- ApplicationUtils.setInstance(application);
- ss.info(this, "Appliation is configured.");
- } catch (Exception e) {
- ss.fatal(this, "Failed to initialize the Application.", e);
- }
+ ConfigurationTripleSource configurationTripleSource = app
+ .getConfigurationTripleSource();
+ configurationTripleSource.startup(app, css);
+ ss.info(this, "Started the ConfigurationTripleSource: "
+ + configurationTripleSource);
+
+ configureJena();
+ prepareCombinedTripleSource(app, ctx);
+ }
+
+ private void configureJena() {
+ // we do not want to fetch imports when we wrap Models in OntModels
+ OntDocumentManager.getInstance().setProcessImports(false);
+ }
+
+ private void prepareCombinedTripleSource(Application app,
+ ServletContext ctx) {
+ ContentTripleSource contentSource = app.getContentTripleSource();
+ ConfigurationTripleSource configurationSource = app
+ .getConfigurationTripleSource();
+ BasicCombinedTripleSource source = new BasicCombinedTripleSource(
+ contentSource, configurationSource);
+
+ RDFServiceUtils.setRDFServiceFactory(ctx,
+ contentSource.getRDFServiceFactory());
+ RDFServiceUtils.setRDFServiceFactory(ctx,
+ configurationSource.getRDFServiceFactory(), CONFIGURATION);
+
+ ModelAccess.setCombinedTripleSource(source);
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
- application.getFileStorage().shutdown(application);
- application.getImageProcessor().shutdown(application);
- application.getSearchEngine().shutdown(application);
+ Application app = ApplicationUtils.instance();
+ app.getSearchEngine().shutdown(app);
+ app.getImageProcessor().shutdown(app);
+ app.getFileStorage().shutdown(app);
}
-
}
+
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationSetup.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationSetup.java
new file mode 100644
index 000000000..21459ad3d
--- /dev/null
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationSetup.java
@@ -0,0 +1,115 @@
+/* $This file is distributed under the terms of the license in /doc/license.txt$ */
+
+package edu.cornell.mannlib.vitro.webapp.application;
+
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.Set;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+
+import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.ConfigurationBeanLoader;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.ConfigurationBeanLoaderException;
+import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockableModel;
+
+/**
+ * Read the application setup file and create the components it describes.
+ */
+public class ApplicationSetup implements ServletContextListener {
+ private static final String APPLICATION_SETUP_PATH = "config/applicationSetup.n3";
+
+ private ServletContext ctx;
+ private StartupStatus ss;
+
+ private ApplicationImpl app;
+
+ private VitroHomeDirectory vitroHomeDir;
+
+ private Path configFile;
+ private LockableModel configModel;
+ private ConfigurationBeanLoader loader;
+
+ @Override
+ public void contextInitialized(ServletContextEvent sce) {
+ try {
+ this.ctx = sce.getServletContext();
+ this.ss = StartupStatus.getBean(ctx);
+
+ this.vitroHomeDir = VitroHomeDirectory.find(ctx);
+ ss.info(this, vitroHomeDir.getDiscoveryMessage());
+
+ locateApplicationConfigFile();
+ loadApplicationConfigFile();
+ createConfigurationBeanLoader();
+ instantiateTheApplication();
+
+ app.setServletContext(this.ctx);
+ app.setHomeDirectory(this.vitroHomeDir);
+
+ ApplicationUtils.setInstance(app);
+ ss.info(this, "Application is configured.");
+ } catch (Exception e) {
+ ss.fatal(this, "Failed to initialize the Application.", e);
+ }
+ }
+
+ private void locateApplicationConfigFile() {
+ Path path = this.vitroHomeDir.getPath().resolve(APPLICATION_SETUP_PATH);
+ if (!Files.exists(path)) {
+ throw new IllegalStateException("'" + path + "' does not exist.");
+ }
+ if (!Files.isReadable(path)) {
+ throw new IllegalStateException("Can't read '" + path + "'");
+ }
+ this.configFile = path;
+ }
+
+ private void loadApplicationConfigFile() {
+ try (InputStream in = Files.newInputStream(this.configFile)) {
+ Model m = ModelFactory.createDefaultModel();
+ m.read(in, null, "N3");
+ this.configModel = new LockableModel(m);
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to read '" + this.configFile
+ + "'", e);
+ }
+ }
+
+ private void createConfigurationBeanLoader() {
+ this.loader = new ConfigurationBeanLoader(configModel);
+ }
+
+ private void instantiateTheApplication() {
+ try {
+ Set apps = loader.loadAll(ApplicationImpl.class);
+ if (apps.isEmpty()) {
+ throw new IllegalStateException("'" + this.configFile
+ + "' does not define an instance of "
+ + ApplicationImpl.class.getName());
+ } else if (apps.size() > 1) {
+ throw new IllegalStateException("'" + this.configFile
+ + "' defines " + apps.size() + " instances of "
+ + ApplicationImpl.class.getName());
+ } else {
+ this.app = apps.iterator().next();
+ }
+ } catch (ConfigurationBeanLoaderException e) {
+ throw new IllegalStateException("Failed to setup the application",
+ e);
+ }
+ }
+
+ @Override
+ public void contextDestroyed(ServletContextEvent sce) {
+ if (app != null) {
+ app.shutdown();
+ }
+ }
+}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationUtils.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationUtils.java
index 01097e579..90b44f665 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationUtils.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/ApplicationUtils.java
@@ -12,7 +12,7 @@ import edu.cornell.mannlib.vitro.webapp.modules.Application;
*/
public class ApplicationUtils {
private static final Log log = LogFactory.getLog(ApplicationUtils.class);
-
+
private static volatile Application instance;
public static Application instance() {
@@ -25,9 +25,8 @@ public class ApplicationUtils {
"Called for Application before it was available", e);
}
}
-
+
static void setInstance(Application application) {
instance = application;
}
-
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/application/BuildProperties.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/BuildProperties.java
new file mode 100644
index 000000000..19438b13f
--- /dev/null
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/BuildProperties.java
@@ -0,0 +1,54 @@
+/* $This file is distributed under the terms of the license in /doc/license.txt$ */
+
+package edu.cornell.mannlib.vitro.webapp.application;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.servlet.ServletContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Obtains and provides the contents of the build.properties file.
+ */
+public class BuildProperties {
+ private static final Log log = LogFactory.getLog(BuildProperties.class);
+
+ /** Path to the file of build properties baked into the webapp. */
+ public static final String WEBAPP_PATH_BUILD_PROPERTIES = "/WEB-INF/resources/build.properties";
+
+ private final Map propertyMap;
+
+ public BuildProperties(ServletContext ctx) {
+ Map map = new HashMap<>();
+
+ try (InputStream stream = ctx
+ .getResourceAsStream(WEBAPP_PATH_BUILD_PROPERTIES)) {
+ if (stream == null) {
+ log.debug("Didn't find a resource at '"
+ + WEBAPP_PATH_BUILD_PROPERTIES + "'.");
+ } else {
+ Properties props = new Properties();
+ props.load(stream);
+ for (String key : props.stringPropertyNames()) {
+ map.put(key, props.getProperty(key));
+ }
+ }
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to load from '"
+ + WEBAPP_PATH_BUILD_PROPERTIES + "'.", e);
+ }
+ propertyMap = Collections.unmodifiableMap(map);
+ }
+
+ public Map getMap() {
+ return this.propertyMap;
+ }
+
+}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectory.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectory.java
new file mode 100644
index 000000000..5ddb53f54
--- /dev/null
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/application/VitroHomeDirectory.java
@@ -0,0 +1,213 @@
+/* $This file is distributed under the terms of the license in /doc/license.txt$ */
+
+package edu.cornell.mannlib.vitro.webapp.application;
+
+import static edu.cornell.mannlib.vitro.webapp.application.BuildProperties.WEBAPP_PATH_BUILD_PROPERTIES;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.InitialContext;
+import javax.servlet.ServletContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Encapsulates some of the info relating to the Vitro home directory.
+ */
+public class VitroHomeDirectory {
+ private static final Log log = LogFactory.getLog(VitroHomeDirectory.class);
+
+ public static VitroHomeDirectory find(ServletContext ctx) {
+ HomeDirectoryFinder finder = new HomeDirectoryFinder(ctx);
+ return new VitroHomeDirectory(ctx, finder.getPath(),
+ finder.getMessage());
+ }
+
+ private final ServletContext ctx;
+ private final Path path;
+ private final String discoveryMessage;
+
+ public VitroHomeDirectory(ServletContext ctx, Path path,
+ String discoveryMessage) {
+ this.ctx = ctx;
+ this.path = path;
+ this.discoveryMessage = discoveryMessage;
+ }
+
+ public ServletContext getCtx() {
+ return ctx;
+ }
+
+ public Path getPath() {
+ return path;
+ }
+
+ public String getDiscoveryMessage() {
+ return discoveryMessage;
+ }
+
+ /**
+ * Find something that specifies the location of the Vitro home directory.
+ * Look in the JDNI environment, the system properties, and the
+ * build.properties file.
+ *
+ * If we don't find it, fail. If we find it more than once, use the first
+ * one (with a warning). If it is not an existing, readable directory, fail.
+ */
+ private static class HomeDirectoryFinder {
+ /** JNDI path that defines the Vitro home directory */
+ private static final String VHD_JNDI_PATH = "java:comp/env/vitro/home";
+
+ /** System property that defines the Vitro home directory */
+ private static final String VHD_SYSTEM_PROPERTY = "vitro.home";
+
+ /** build.properties property that defines the Vitro home directory */
+ private static final String VHD_BUILD_PROPERTY = "vitro.home";
+
+ private final ServletContext ctx;
+ private final List foundLocations = new ArrayList<>();
+
+ public HomeDirectoryFinder(ServletContext ctx) {
+ this.ctx = ctx;
+
+ getVhdFromJndi();
+ getVhdFromSystemProperties();
+ getVhdFromBuildProperties();
+ confirmExactlyOneResult();
+ confirmValidDirectory();
+ }
+
+ public String getMessage() {
+ return foundLocations.get(0).getMessage();
+ }
+
+ public Path getPath() {
+ return foundLocations.get(0).getPath();
+ }
+
+ public void getVhdFromJndi() {
+ try {
+ String vhdPath = (String) new InitialContext()
+ .lookup(VHD_JNDI_PATH);
+ if (vhdPath == null) {
+ log.debug("Didn't find a JNDI value at '" + VHD_JNDI_PATH
+ + "'.");
+ } else {
+ log.debug("'" + VHD_JNDI_PATH + "' as specified by JNDI: "
+ + vhdPath);
+ String message = String.format(
+ "JNDI environment '%s' was set to '%s'",
+ VHD_JNDI_PATH, vhdPath);
+ foundLocations.add(new Found(Paths.get(vhdPath), message));
+ }
+ } catch (Exception e) {
+ log.debug("JNDI lookup failed. " + e);
+ }
+ }
+
+ private void getVhdFromSystemProperties() {
+ String vhdPath = System.getProperty(VHD_SYSTEM_PROPERTY);
+ if (vhdPath == null) {
+ log.debug("Didn't find a system property value at '"
+ + VHD_SYSTEM_PROPERTY + "'.");
+ } else {
+ log.debug("'" + VHD_SYSTEM_PROPERTY
+ + "' as specified by system property: " + vhdPath);
+ String message = String.format(
+ "System property '%s' was set to '%s'",
+ VHD_SYSTEM_PROPERTY, vhdPath);
+ foundLocations.add(new Found(Paths.get(vhdPath), message));
+ }
+ }
+
+ private void getVhdFromBuildProperties() {
+ try {
+ Map buildProps = new BuildProperties(ctx)
+ .getMap();
+ String vhdPath = buildProps.get(VHD_BUILD_PROPERTY);
+ if (vhdPath == null) {
+ log.debug("build properties doesn't contain a value for '"
+ + VHD_BUILD_PROPERTY + "'.");
+ } else {
+ log.debug("'" + VHD_BUILD_PROPERTY
+ + "' as specified by build.properties: " + vhdPath);
+ String message = String.format(
+ "In resource '%s', '%s' was set to '%s'.",
+ WEBAPP_PATH_BUILD_PROPERTIES, VHD_BUILD_PROPERTY,
+ vhdPath);
+ foundLocations.add(new Found(Paths.get(vhdPath), message));
+ }
+ } catch (Exception e) {
+ log.warn("Reading build properties failed. " + e);
+ }
+ }
+
+ private void confirmExactlyOneResult() {
+ if (foundLocations.isEmpty()) {
+ String message = String.format("Can't find a value "
+ + "for the Vitro home directory. "
+ + "Looked in JNDI environment at '%s'. "
+ + "Looked for a system property named '%s'. "
+ + "Looked in 'WEB-INF/resources/build.properties' "
+ + "for '%s'.", VHD_JNDI_PATH, VHD_SYSTEM_PROPERTY,
+ VHD_BUILD_PROPERTY);
+ throw new IllegalStateException(message);
+ } else if (foundLocations.size() > 1) {
+ String message = String.format("Found multiple values for the "
+ + "Vitro home directory: " + foundLocations);
+ log.warn(message);
+ }
+ }
+
+ private void confirmValidDirectory() {
+ Path vhd = getPath();
+ if (!Files.exists(vhd)) {
+ throw new IllegalStateException("Vitro home directory '" + vhd
+ + "' does not exist.");
+ }
+ if (!Files.isDirectory(vhd)) {
+ throw new IllegalStateException("Vitro home directory '" + vhd
+ + "' is not a directory.");
+ }
+ if (!Files.isReadable(vhd)) {
+ throw new IllegalStateException(
+ "Cannot read Vitro home directory '" + vhd + "'.");
+ }
+ if (!Files.isWritable(vhd)) {
+ throw new IllegalStateException(
+ "Can't write to Vitro home directory: '" + vhd + "'.");
+ }
+ }
+
+ /** We found it: where and how. */
+ private static class Found {
+ private final Path path;
+ private final String message;
+
+ public Found(Path path, String message) {
+ this.path = path;
+ this.message = message;
+ }
+
+ public Path getPath() {
+ return path;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public String toString() {
+ return "Found[path=" + path + ", message=" + message + "]";
+ }
+ }
+ }
+
+}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/config/ConfigurationPropertiesSetup.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/config/ConfigurationPropertiesSetup.java
index 410e9e76b..3ba0cd937 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/config/ConfigurationPropertiesSetup.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/config/ConfigurationPropertiesSetup.java
@@ -7,12 +7,8 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
-import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.Properties;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
@@ -20,6 +16,8 @@ import javax.servlet.ServletContextListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
+import edu.cornell.mannlib.vitro.webapp.application.BuildProperties;
import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
/**
@@ -48,23 +46,11 @@ public class ConfigurationPropertiesSetup implements ServletContextListener {
private static final Log log = LogFactory
.getLog(ConfigurationPropertiesSetup.class);
- /** JNDI path that defines the Vitro home directory */
- private static final String VHD_JNDI_PATH = "java:comp/env/vitro/home";
-
- /** System property that defines the Vitro home directory */
- private static final String VHD_SYSTEM_PROPERTY = "vitro.home";
-
- /** build.properties property that defines the Vitro home directory */
- private static final String VHD_BUILD_PROPERTY = "vitro.home";
-
- /** Configuration property to store the Vitro home directory */
- private static final String VHD_CONFIGURATION_PROPERTY = "vitro.home";
-
/** Name of the file that contains runtime properties. */
private static final String FILE_RUNTIME_PROPERTIES = "runtime.properties";
- /** Path to the file of build properties baked into the webapp. */
- private static final String PATH_BUILD_PROPERTIES = "/WEB-INF/resources/build.properties";
+ /** Configuration property to store the Vitro home directory */
+ private static final String VHD_CONFIGURATION_PROPERTY = "vitro.home";
@Override
public void contextInitialized(ServletContextEvent sce) {
@@ -74,7 +60,8 @@ public class ConfigurationPropertiesSetup implements ServletContextListener {
try {
InputStream stream = null;
try {
- File vitroHomeDir = locateVitroHomeDirectory(ctx, ss);
+ File vitroHomeDir = ApplicationUtils.instance()
+ .getHomeDirectory().getPath().toFile();
File runtimePropertiesFile = locateRuntimePropertiesFile(
vitroHomeDir, ss);
@@ -82,9 +69,9 @@ public class ConfigurationPropertiesSetup implements ServletContextListener {
Map preempts = createPreemptiveProperties(
VHD_CONFIGURATION_PROPERTY, vitroHomeDir);
-
+
ConfigurationPropertiesImpl bean = new ConfigurationPropertiesImpl(
- stream, preempts, getBuildProperties(ctx));
+ stream, preempts, new BuildProperties(ctx).getMap());
ConfigurationProperties.setBean(ctx, bean);
ss.info(this, "Loaded " + bean.getPropertyMap().size()
@@ -103,141 +90,6 @@ public class ConfigurationPropertiesSetup implements ServletContextListener {
}
}
- /**
- * Look in the JDNI environment, the system properties, and the
- * build.properties file.
- *
- * If we don't find it, fail. If we find it more than once, warn and use the
- * first one.
- *
- * Confirm that it is an existing, readable directory.
- */
- private File locateVitroHomeDirectory(ServletContext ctx, StartupStatus ss) {
- Map whereWasIt = new LinkedHashMap();
- getVhdFromJndi(whereWasIt);
- getVhdFromSystemProperties(whereWasIt);
- getVhdFromBuildProperties(ctx, whereWasIt);
-
- if (whereWasIt.isEmpty()) {
- String message = String.format("Can't find a value "
- + "for the Vitro home directory. "
- + "Looked in JNDI environment at '%s'. "
- + "Looked for a system property named '%s'. "
- + "Looked in 'WEB-INF/resources/build.properties' "
- + "for '%s'.", VHD_JNDI_PATH, VHD_SYSTEM_PROPERTY,
- VHD_BUILD_PROPERTY);
- throw new IllegalStateException(message);
- } else if (whereWasIt.size() > 1) {
- String message = String.format("Found multiple values for the "
- + "Vitro home directory: " + whereWasIt.keySet());
- ss.warning(this, message);
- }
- String message = whereWasIt.keySet().iterator().next();
- String vhdPath = whereWasIt.values().iterator().next();
-
- ss.info(this, message);
-
- File vhd = new File(vhdPath);
- if (!vhd.exists()) {
- throw new IllegalStateException("Vitro home directory '" + vhdPath
- + "' does not exist.");
- }
- if (!vhd.isDirectory()) {
- throw new IllegalStateException("Vitro home directory '" + vhdPath
- + "' is not a directory.");
- }
- if (!vhd.canRead()) {
- throw new IllegalStateException("Vitro home directory '" + vhdPath
- + "' cannot be read.");
- }
- if (!vhd.canWrite()) {
- throw new IllegalStateException(
- "Can't write to Vitro home directory: '" + vhdPath + "'.");
- }
-
- return vhd;
- }
-
- private void getVhdFromJndi(Map whereWasIt) {
- try {
- String vhdPath = (String) new InitialContext()
- .lookup(VHD_JNDI_PATH);
-
- if (vhdPath == null) {
- log.debug("Didn't find a JNDI value at '" + VHD_JNDI_PATH
- + "'.");
- return;
- }
-
- log.debug("'" + VHD_JNDI_PATH + "' as specified by JNDI: "
- + vhdPath);
- String message = String.format(
- "JNDI environment '%s' was set to '%s'", VHD_JNDI_PATH,
- vhdPath);
- whereWasIt.put(message, vhdPath);
- } catch (NamingException e) {
- log.debug("JNDI lookup failed. " + e);
- }
- }
-
- private void getVhdFromSystemProperties(Map whereWasIt) {
- String vhdPath = System.getProperty(VHD_SYSTEM_PROPERTY);
-
- if (vhdPath == null) {
- log.debug("Didn't find a system property value at '"
- + VHD_SYSTEM_PROPERTY + "'.");
- return;
- }
-
- log.debug("'" + VHD_SYSTEM_PROPERTY
- + "' as specified by system property: " + vhdPath);
- String message = String.format("System property '%s' was set to '%s'",
- VHD_SYSTEM_PROPERTY, vhdPath);
- whereWasIt.put(message, vhdPath);
- }
-
- private void getVhdFromBuildProperties(ServletContext ctx,
- Map whereWasIt) {
- Map buildProps = getBuildProperties(ctx);
- String vhdPath = buildProps.get(VHD_BUILD_PROPERTY);
- if (vhdPath == null) {
- log.debug("'" + PATH_BUILD_PROPERTIES
- + "' didn't contain a value for '" + VHD_BUILD_PROPERTY
- + "'.");
- return;
- }
-
- log.debug("'" + VHD_BUILD_PROPERTY
- + "' as specified by build.properties: " + vhdPath);
- String message = String.format(
- "In resource '%s', '%s' was set to '%s'.",
- PATH_BUILD_PROPERTIES, VHD_BUILD_PROPERTY, vhdPath);
- whereWasIt.put(message, vhdPath);
- }
-
- private Map getBuildProperties(ServletContext ctx) {
- Map map = new HashMap<>();
-
- try (InputStream stream = ctx
- .getResourceAsStream(PATH_BUILD_PROPERTIES)) {
- if (stream == null) {
- log.debug("Didn't find a resource at '" + PATH_BUILD_PROPERTIES
- + "'.");
- } else {
-
- Properties props = new Properties();
- props.load(stream);
- for (String key : props.stringPropertyNames()) {
- map.put(key, props.getProperty(key));
- }
- }
- } catch (IOException e) {
- throw new SetupException("Failed to load from '"
- + PATH_BUILD_PROPERTIES + "'.", e);
- }
- return map;
- }
-
private File locateRuntimePropertiesFile(File vitroHomeDir, StartupStatus ss) {
File rpf = new File(vitroHomeDir, FILE_RUNTIME_PROPERTIES);
@@ -270,13 +122,4 @@ public class ConfigurationPropertiesSetup implements ServletContextListener {
// No need to remove the bean. It's only a map of strings, and if we
// restart the app, it will be replaced.
}
-
- /**
- * Indicates a problem setting up. Abandon ship.
- */
- private static class SetupException extends RuntimeException {
- public SetupException(String message, Throwable cause) {
- super(message, cause);
- }
- }
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/config/ConfigurationPropertiesSmokeTests.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/config/ConfigurationPropertiesSmokeTests.java
index 604881b2c..31e21da32 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/config/ConfigurationPropertiesSmokeTests.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/config/ConfigurationPropertiesSmokeTests.java
@@ -25,7 +25,6 @@ public class ConfigurationPropertiesSmokeTests implements
private static final Log log = LogFactory
.getLog(ConfigurationPropertiesSmokeTests.class);
- private static final String PROPERTY_HOME_DIRECTORY = "vitro.home";
private static final String PROPERTY_DEFAULT_NAMESPACE = "Vitro.defaultNamespace";
private static final String PROPERTY_LANGUAGE_BUILD = "languages.addToBuild";
private static final String PROPERTY_LANGUAGE_SELECTABLE = "languages.selectableLocales";
@@ -38,47 +37,10 @@ public class ConfigurationPropertiesSmokeTests implements
ConfigurationProperties props = ConfigurationProperties.getBean(ctx);
StartupStatus ss = StartupStatus.getBean(ctx);
- checkHomeDirectory(ctx, props, ss);
checkDefaultNamespace(ctx, props, ss);
checkLanguages(props, ss);
}
- /**
- * Confirm that: a home directory has been specified; it exists; it is a
- * directory; it is readable and writable.
- */
- private void checkHomeDirectory(ServletContext ctx,
- ConfigurationProperties props, StartupStatus ss) {
- String homeDirectoryPath = props.getProperty(PROPERTY_HOME_DIRECTORY);
- if (homeDirectoryPath == null || homeDirectoryPath.isEmpty()) {
- ss.fatal(this, "Can't find a value for the home directory: '"
- + PROPERTY_HOME_DIRECTORY + "'");
- return;
- }
-
- File homeDirectory = new File(homeDirectoryPath);
- if (!homeDirectory.exists()) {
- ss.fatal(this, PROPERTY_HOME_DIRECTORY + " '" + homeDirectoryPath
- + "' does not exist.");
- return;
- }
- if (!homeDirectory.isDirectory()) {
- ss.fatal(this, PROPERTY_HOME_DIRECTORY + " '" + homeDirectoryPath
- + "' is not a directory.");
- return;
- }
-
- if (!homeDirectory.canRead()) {
- ss.fatal(this, PROPERTY_HOME_DIRECTORY + " '" + homeDirectoryPath
- + "' cannot be read.");
- }
- if (!homeDirectory.canWrite()) {
- ss.fatal(this, PROPERTY_HOME_DIRECTORY + " '" + homeDirectoryPath
- + "' cannot be written to.");
- }
- }
-
-
/**
* Confirm that the default namespace is specified and a syntactically valid
* URI. It should also end with "/individual/".
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/edit/FauxPropertyRetryController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/edit/FauxPropertyRetryController.java
index e271dc1ad..9c6cdfd3a 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/edit/FauxPropertyRetryController.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/edit/FauxPropertyRetryController.java
@@ -180,6 +180,7 @@ public class FauxPropertyRetryController extends BaseEditController {
.getHiddenFromPublishBelowRoleLevel());
fp.setProhibitedFromUpdateBelowRoleLevel(base
.getProhibitedFromUpdateBelowRoleLevel());
+ fp.setCustomEntryForm(base.getCustomEntryForm());
log.debug("Created new FauxProperty: " + fp);
return fp;
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ContactMailController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ContactMailController.java
index a48d040f0..4a275a607 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ContactMailController.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/ContactMailController.java
@@ -25,8 +25,8 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
import edu.cornell.mannlib.vitro.webapp.beans.ApplicationBean;
-import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.TemplateProcessingHelper.TemplateProcessingException;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues;
@@ -50,7 +50,6 @@ public class ContactMailController extends FreemarkerHttpServlet {
private final static String TEMPLATE_ERROR = "contactForm-error.ftl";
private final static String TEMPLATE_FORM = "contactForm-form.ftl";
- private static final String PROPERTY_VITRO_HOME_DIR = "vitro.home";
private static final String EMAIL_JOURNAL_FILE_DIR = "emailJournal";
private static final String EMAIL_JOURNAL_FILE_NAME = "contactFormEmails.html";
@@ -116,7 +115,7 @@ public class ContactMailController extends FreemarkerHttpServlet {
try {
// Write the message to the journal file
- FileWriter fw = new FileWriter(locateTheJournalFile(vreq),true);
+ FileWriter fw = new FileWriter(locateTheJournalFile(), true);
PrintWriter outFile = new PrintWriter(fw);
writeBackupCopy(outFile, msgText, vreq);
@@ -159,21 +158,8 @@ public class ContactMailController extends FreemarkerHttpServlet {
* The journal file belongs in a sub-directory of the Vitro home directory.
* If the sub-directory doesn't exist, create it.
*/
- private File locateTheJournalFile(VitroRequest vreq) {
- String homeDirPath = ConfigurationProperties.getBean(vreq).getProperty(
- PROPERTY_VITRO_HOME_DIR);
- if (homeDirPath == null) {
- throw new IllegalArgumentException(
- "Configuration properties must contain a value for '"
- + PROPERTY_VITRO_HOME_DIR + "'");
- }
-
- File homeDir = new File(homeDirPath);
- if (!homeDir.exists()) {
- throw new IllegalStateException("Vitro home directory '"
- + homeDir.getAbsolutePath() + "' does not exist.");
- }
-
+ private File locateTheJournalFile() {
+ File homeDir = ApplicationUtils.instance().getHomeDirectory().getPath().toFile();
File journalDir = new File(homeDir, EMAIL_JOURNAL_FILE_DIR);
if (!journalDir.exists()) {
boolean created = journalDir.mkdir();
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/FauxPropertyDaoJena.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/FauxPropertyDaoJena.java
index 6b3a4a50d..dfed53060 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/FauxPropertyDaoJena.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/jena/FauxPropertyDaoJena.java
@@ -26,6 +26,7 @@ import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.ResIterator;
import com.hp.hpl.jena.rdf.model.Resource;
+import com.hp.hpl.jena.vocabulary.OWL;
import com.hp.hpl.jena.vocabulary.RDF;
import edu.cornell.mannlib.vitro.webapp.beans.FauxProperty;
@@ -273,9 +274,11 @@ public class FauxPropertyDaoJena extends JenaBaseDao implements FauxPropertyDao
private static final String VCARD_KIND_URI = "http://www.w3.org/2006/vcard/ns#Kind";
private static final String VCARD_NAMESPACE = "http://www.w3.org/2006/vcard/ns#";
+
private void storeQualifiedByRoot(OntResource context, String rangeURI) {
if (rangeURI.startsWith(VCARD_NAMESPACE)) {
- updatePropertyResourceURIValue(context, QUALIFIED_BY_ROOT, VCARD_KIND_URI);
+ updatePropertyResourceURIValue(context, QUALIFIED_BY_ROOT,
+ VCARD_KIND_URI);
} else {
updatePropertyResourceURIValue(context, QUALIFIED_BY_ROOT, null);
}
@@ -504,8 +507,6 @@ public class FauxPropertyDaoJena extends JenaBaseDao implements FauxPropertyDao
+ " :hasConfiguration ?config . \n" //
+ "} \n"; //
- // TODO Add a filter that will reject solutions that include
- // qualifiedByDomain
private static final String QUERY_LOCATE_CONFIG_CONTEXT_WITH_NO_DOMAIN = "" //
+ "PREFIX : \n" //
+ "\n" //
@@ -515,6 +516,9 @@ public class FauxPropertyDaoJena extends JenaBaseDao implements FauxPropertyDao
+ " :configContextFor ?baseUri ; \n" //
+ " :qualifiedBy ?rangeUri ; \n" //
+ " :hasConfiguration ?config . \n" //
+ + " FILTER NOT EXISTS { \n" //
+ + " ?context :qualifiedByDomain ?domainUri \n" //
+ + " } \n" //
+ "} \n"; //
private static class ParserLocateConfigContext extends
@@ -558,7 +562,8 @@ public class FauxPropertyDaoJena extends JenaBaseDao implements FauxPropertyDao
String baseUri, String rangeUri) {
try (LockedOntModel displayModel = lockableDisplayModel.read()) {
String queryString;
- if (domainUri == null || domainUri.trim().isEmpty()) {
+ if (domainUri == null || domainUri.trim().isEmpty()
+ || domainUri.equals(OWL.Thing.getURI())) {
queryString = bindValues(
QUERY_LOCATE_CONFIG_CONTEXT_WITH_NO_DOMAIN,
uriValue("baseUri", baseUri),
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/filestorage/impl/FileStorageImplWrapper.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/filestorage/impl/FileStorageImplWrapper.java
index e3934428a..51254f1fd 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/filestorage/impl/FileStorageImplWrapper.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/filestorage/impl/FileStorageImplWrapper.java
@@ -11,6 +11,7 @@ import java.util.Collections;
import javax.servlet.ServletContext;
+import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
import edu.cornell.mannlib.vitro.webapp.modules.Application;
import edu.cornell.mannlib.vitro.webapp.modules.ComponentStartupStatus;
@@ -22,7 +23,6 @@ import edu.cornell.mannlib.vitro.webapp.modules.fileStorage.FileStorage;
*/
public class FileStorageImplWrapper implements FileStorage {
public static final String PROPERTY_DEFAULT_NAMESPACE = "Vitro.defaultNamespace";
- public static final String PROPERTY_VITRO_HOME_DIR = "vitro.home";
public static final String FILE_STORAGE_SUBDIRECTORY = "uploads";
private FileStorageImpl fs;
@@ -35,7 +35,7 @@ public class FileStorageImplWrapper implements FileStorage {
ServletContext ctx = application.getServletContext();
try {
- File baseDirectory = figureBaseDir(ctx);
+ File baseDirectory = figureBaseDir();
Collection fileNamespace = confirmDefaultNamespace(ctx);
fs = new FileStorageImpl(baseDirectory, fileNamespace);
} catch (Exception e) {
@@ -47,21 +47,8 @@ public class FileStorageImplWrapper implements FileStorage {
* Get the configuration property for the file storage base directory, and
* check that it points to an existing, writeable directory.
*/
- private File figureBaseDir(ServletContext ctx) throws IOException {
- String homeDirPath = ConfigurationProperties.getBean(ctx).getProperty(
- PROPERTY_VITRO_HOME_DIR);
- if (homeDirPath == null) {
- throw new IllegalArgumentException(
- "Configuration properties must contain a value for '"
- + PROPERTY_VITRO_HOME_DIR + "'");
- }
-
- File homeDir = new File(homeDirPath);
- if (!homeDir.exists()) {
- throw new IllegalStateException("Vitro home directory '"
- + homeDir.getAbsolutePath() + "' does not exist.");
- }
-
+ private File figureBaseDir() throws IOException {
+ File homeDir = ApplicationUtils.instance().getHomeDirectory().getPath().toFile();
File baseDir = new File(homeDir, FILE_STORAGE_SUBDIRECTORY);
if (!baseDir.exists()) {
boolean created = baseDir.mkdir();
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/ModelAccess.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/ModelAccess.java
index cb2697390..bc9cc48ae 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/ModelAccess.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/ModelAccess.java
@@ -10,7 +10,7 @@ import org.apache.commons.logging.LogFactory;
import edu.cornell.mannlib.vitro.webapp.modelaccess.impl.ContextModelAccessImpl;
import edu.cornell.mannlib.vitro.webapp.modelaccess.impl.RequestModelAccessImpl;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.DataStructuresProvider;
+import edu.cornell.mannlib.vitro.webapp.triplesource.CombinedTripleSource;
/**
* The root access point for the RDF data structures: RDFServices, Datasets,
@@ -136,18 +136,18 @@ public class ModelAccess {
// The factory
// ----------------------------------------------------------------------
- private static volatile DataStructuresProvider dataStructuresProvider;
+ private static volatile CombinedTripleSource combinedTripleSource;
private static volatile ModelAccessFactory factory = new ModelAccessFactory();
/** These attributes should only be accessed through this class. */
private static final String ATTRIBUTE_NAME = ModelAccess.class.getName();
- public static void setDataStructuresProvider(DataStructuresProvider provider) {
- if (dataStructuresProvider != null) {
- log.warn("Assigning DataStructuresProvider " + provider
- + ", but was already set to " + dataStructuresProvider);
+ public static void setCombinedTripleSource(CombinedTripleSource source) {
+ if (combinedTripleSource != null) {
+ log.warn("Assigning CombinedTripleSource " + source
+ + ", but was already set to " + combinedTripleSource);
}
- dataStructuresProvider = provider;
+ combinedTripleSource = source;
}
public static RequestModelAccess on(HttpServletRequest req) {
@@ -182,7 +182,7 @@ public class ModelAccess {
public static class ModelAccessFactory {
public ContextModelAccess buildContextModelAccess(ServletContext ctx) {
- return new ContextModelAccessImpl(ctx, dataStructuresProvider);
+ return new ContextModelAccessImpl(ctx, combinedTripleSource);
}
/**
@@ -191,8 +191,7 @@ public class ModelAccess {
*/
public RequestModelAccess buildRequestModelAccess(HttpServletRequest req) {
return new RequestModelAccessImpl(req,
- dataStructuresProvider
- .getShortTermDataStructuresProvider(req));
+ combinedTripleSource.getShortTermCombinedTripleSource(req));
}
}
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/impl/ContextModelAccessImpl.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/impl/ContextModelAccessImpl.java
index 85b71fc53..da05f7997 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/impl/ContextModelAccessImpl.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/impl/ContextModelAccessImpl.java
@@ -45,7 +45,7 @@ import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.ReasoningOption;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.OntModelCache;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.DataStructuresProvider;
+import edu.cornell.mannlib.vitro.webapp.triplesource.CombinedTripleSource;
import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
/**
@@ -66,7 +66,7 @@ public class ContextModelAccessImpl implements ContextModelAccess {
private final ConfigurationProperties props;
- private final DataStructuresProvider factory;
+ private final CombinedTripleSource factory;
private final Map rdfServiceMap;
private final Map datasetMap;
@@ -86,7 +86,7 @@ public class ContextModelAccessImpl implements ContextModelAccess {
* requested.
*/
public ContextModelAccessImpl(ServletContext ctx,
- DataStructuresProvider factory) {
+ CombinedTripleSource factory) {
this.props = ConfigurationProperties.getBean(ctx);
this.factory = factory;
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/impl/RequestModelAccessImpl.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/impl/RequestModelAccessImpl.java
index c6b9277bd..341f41d73 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/impl/RequestModelAccessImpl.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/modelaccess/impl/RequestModelAccessImpl.java
@@ -51,7 +51,7 @@ import edu.cornell.mannlib.vitro.webapp.modelaccess.impl.keys.WebappDaoFactoryKe
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.filter.LanguageFilteringRDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.filter.LanguageFilteringUtils;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.ShortTermDataStructuresProvider;
+import edu.cornell.mannlib.vitro.webapp.triplesource.ShortTermCombinedTripleSource;
import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
/**
@@ -89,14 +89,14 @@ public class RequestModelAccessImpl implements RequestModelAccess {
private final HttpServletRequest req;
private final ServletContext ctx;
private final ConfigurationProperties props;
- private final ShortTermDataStructuresProvider provider;
+ private final ShortTermCombinedTripleSource source;
public RequestModelAccessImpl(HttpServletRequest req,
- ShortTermDataStructuresProvider provider) {
+ ShortTermCombinedTripleSource source) {
this.req = req;
this.ctx = req.getSession().getServletContext();
this.props = ConfigurationProperties.getBean(req);
- this.provider = provider;
+ this.source = source;
}
/**
@@ -113,13 +113,13 @@ public class RequestModelAccessImpl implements RequestModelAccess {
@Override
public void close() {
- this.provider.close();
+ this.source.close();
}
@Override
public String toString() {
return "RequestModelAccessImpl[" + ToString.hashHex(this) + ", req="
- + ToString.hashHex(req) + ", provider=" + provider + "]";
+ + ToString.hashHex(req) + ", source=" + source + "]";
}
// ----------------------------------------------------------------------
@@ -149,7 +149,7 @@ public class RequestModelAccessImpl implements RequestModelAccess {
if (key.getLanguageOption() == LANGUAGE_AWARE) {
return addLanguageAwareness(getRDFService(LANGUAGE_NEUTRAL));
} else {
- return provider.getRDFService(key.getWhichService());
+ return source.getRDFService(key.getWhichService());
}
}
@@ -222,7 +222,7 @@ public class RequestModelAccessImpl implements RequestModelAccess {
return addLanguageAwareness(getOntModel(key.getName(),
LANGUAGE_NEUTRAL));
} else {
- return provider.getOntModelCache().getOntModel(key.getName());
+ return source.getOntModelCache().getOntModel(key.getName());
}
}
@@ -313,7 +313,7 @@ public class RequestModelAccessImpl implements RequestModelAccess {
RDFService rdfService = getRDFService(key.rdfServiceKey());
OntModelSelector ontModelSelector = getOntModelSelector(key
.ontModelSelectorKey());
- WebappDaoFactoryConfig config = provider.getWebappDaoFactoryConfig();
+ WebappDaoFactoryConfig config = source.getWebappDaoFactoryConfig();
switch (key.getReasoningOption()) {
case ASSERTIONS_ONLY:
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/Application.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/Application.java
index a03016061..2708634f3 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/Application.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/Application.java
@@ -4,21 +4,32 @@ package edu.cornell.mannlib.vitro.webapp.modules;
import javax.servlet.ServletContext;
+import edu.cornell.mannlib.vitro.webapp.application.VitroHomeDirectory;
import edu.cornell.mannlib.vitro.webapp.modules.fileStorage.FileStorage;
import edu.cornell.mannlib.vitro.webapp.modules.imageProcessor.ImageProcessor;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngine;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ConfigurationTripleSource;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ContentTripleSource;
/**
* The interface that holds the modules and extensions together.
*/
public interface Application {
ServletContext getServletContext();
+
+ VitroHomeDirectory getHomeDirectory();
SearchEngine getSearchEngine();
ImageProcessor getImageProcessor();
FileStorage getFileStorage();
+
+ ContentTripleSource getContentTripleSource();
+
+ ConfigurationTripleSource getConfigurationTripleSource();
+
+ void shutdown();
public interface Component {
enum LifecycleState {
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/ConfigurationDataStructuresProvider.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/ConfigurationTripleSource.java
similarity index 77%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/ConfigurationDataStructuresProvider.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/ConfigurationTripleSource.java
index 9d9fa90ab..4a0d35a6b 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/ConfigurationDataStructuresProvider.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/ConfigurationTripleSource.java
@@ -1,6 +1,6 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl;
+package edu.cornell.mannlib.vitro.webapp.modules.tripleSource;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.DISPLAY;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.DISPLAY_DISPLAY;
@@ -10,11 +10,9 @@ import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.USER_ACCOU
import com.hp.hpl.jena.rdf.model.ModelMaker;
/**
- * The base class for a provider of configuration models. It just contains some
- * useful constants and utility methods.
+ * A triple source for configuration models.
*/
-public abstract class ConfigurationDataStructuresProvider implements
- SingleSourceDataStructuresProvider {
+public abstract class ConfigurationTripleSource implements TripleSource {
/**
* A list of all Configuration models, in case the implementation wants to
* add memory-mapping.
@@ -33,5 +31,4 @@ public abstract class ConfigurationDataStructuresProvider implements
}
return sourceMM;
}
-
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/ContentDataStructuresProvider.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/ContentTripleSource.java
similarity index 81%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/ContentDataStructuresProvider.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/ContentTripleSource.java
index f5fa82053..6eb44bc77 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/ContentDataStructuresProvider.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/ContentTripleSource.java
@@ -1,23 +1,20 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl;
+package edu.cornell.mannlib.vitro.webapp.modules.tripleSource;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.APPLICATION_METADATA;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.FULL_UNION;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.TBOX_ASSERTIONS;
-import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.*;
+import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.TBOX_INFERENCES;
import com.hp.hpl.jena.rdf.model.ModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.adapters.NamedDefaultModelMaker;
/**
- * The base class for a provider of content models. It just contains some useful
- * constants and utility methods.
+ * A triple source for content models.
*/
-public abstract class ContentDataStructuresProvider implements
- SingleSourceDataStructuresProvider {
-
+public abstract class ContentTripleSource implements TripleSource {
/**
* These are the small content models that we want to keep in memory.
*/
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/SingleSourceDataStructuresProvider.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/TripleSource.java
similarity index 63%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/SingleSourceDataStructuresProvider.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/TripleSource.java
index cae8beafc..67fad9e35 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/SingleSourceDataStructuresProvider.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/TripleSource.java
@@ -1,22 +1,19 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl;
+package edu.cornell.mannlib.vitro.webapp.modules.tripleSource;
import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.rdf.model.ModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.OntModelCache;
+import edu.cornell.mannlib.vitro.webapp.modules.Application;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
/**
- * An RDFSource that provides Content models or Configuration models, but not
- * both.
- *
- * Repeated calls for the same data structure should yield the same instance,
- * except for the short-term OntModelCache.
+ * A provider of triples and the data structures by which they are accessed.
*/
-public interface SingleSourceDataStructuresProvider extends AutoCloseable {
+public interface TripleSource extends Application.Module{
RDFServiceFactory getRDFServiceFactory();
RDFService getRDFService();
@@ -27,4 +24,7 @@ public interface SingleSourceDataStructuresProvider extends AutoCloseable {
OntModelCache getShortTermOntModels(RDFService shortTermRdfService,
OntModelCache longTermOntModelCache);
+
+ /** Ways in which this TripleSource behaves oddly. */
+ TripleStoreQuirks getQuirks();
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/TripleStoreQuirks.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/TripleStoreQuirks.java
new file mode 100644
index 000000000..19d7ad6c0
--- /dev/null
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/modules/tripleSource/TripleStoreQuirks.java
@@ -0,0 +1,18 @@
+/* $This file is distributed under the terms of the license in /doc/license.txt$ */
+
+package edu.cornell.mannlib.vitro.webapp.modules.tripleSource;
+
+import com.hp.hpl.jena.rdf.model.Model;
+
+/**
+ * TODO
+ */
+public interface TripleStoreQuirks {
+
+ /**
+ * Test to see whether the FileGraph must be updated to reflect the current
+ * state of the file.
+ */
+ boolean hasFileGraphChanged(Model fromFile, Model previous, String graphURI);
+
+}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ContextNodeFields.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ContextNodeFields.java
index 636a61e91..e0e698466 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ContextNodeFields.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ContextNodeFields.java
@@ -15,12 +15,12 @@ import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
+import edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccess;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
-import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputField;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils;
import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.ContextModelsUser;
/**
* DocumentModifier that will run SPARQL queries for an
@@ -30,19 +30,24 @@ import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames;
* @author bdc34
*
*/
-public class ContextNodeFields implements DocumentModifier{
+public class ContextNodeFields implements DocumentModifier, ContextModelsUser{
protected List queries = new ArrayList();
protected boolean shutdown = false;
protected Log log = LogFactory.getLog(ContextNodeFields.class);
- protected RDFServiceFactory rdfServiceFactory;
-
+
+ private RDFService rdfService;
+
+ @Override
+ public void setContextModels(ContextModelAccess models) {
+ this.rdfService = models.getRDFService();
+ }
+
/**
* Construct this with a model to query when building search documents and
* a list of the SPARQL queries to run.
*/
- protected ContextNodeFields(List queries, RDFServiceFactory rdfServiceFactory){
+ protected ContextNodeFields(List queries){
this.queries = queries;
- this.rdfServiceFactory = rdfServiceFactory;
}
@@ -74,7 +79,6 @@ public class ContextNodeFields implements DocumentModifier{
*/
protected StringBuffer executeQueryForValues( Individual individual, Collection queries){
/* execute all the queries on the list and concat the values to add to all text */
- RDFService rdfService = rdfServiceFactory.getRDFService();
StringBuffer allValues = new StringBuffer("");
for(String query : queries ){
@@ -102,8 +106,6 @@ public class ContextNodeFields implements DocumentModifier{
}
allValues.append(valuesForQuery);
}
-
- rdfService.close();
return allValues;
}
@@ -137,4 +139,11 @@ public class ContextNodeFields implements DocumentModifier{
public void shutdown(){
shutdown=true;
}
+
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName() + "[]";
+ }
+
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnNamespace.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnNamespace.java
index 615fdfffd..7e295313b 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnNamespace.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnNamespace.java
@@ -1,34 +1,36 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
-import java.util.Arrays;
+import java.util.ArrayList;
import java.util.List;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Property;
/**
- * Skip individual if its URI is from any of the excludeNamepsaces
- *
+ * Skip individual if its URI is from any of the excludeNamespaces.
*/
public class ExcludeBasedOnNamespace implements SearchIndexExcluder {
- List excludeNamepsaces;
-
-
- public ExcludeBasedOnNamespace(String ... excludeNamepsaces) {
- super();
- this.excludeNamepsaces = Arrays.asList(excludeNamepsaces);
- }
+ private List excludeNamespaces = new ArrayList<>();
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#excludes")
+ public void addExcludedNamespace(String ns) {
+ excludeNamespaces.add(ns);
+ }
- @Override
- public String checkForExclusion(Individual ind) {
- for( String ns: excludeNamepsaces){
- if( ns.equals( ind.getNamespace() ) ){
- return "skipping because of namespace " ;
- }
- }
- return null;
- }
+ @Override
+ public String checkForExclusion(Individual ind) {
+ for (String ns : excludeNamespaces) {
+ if (ns.equals(ind.getNamespace())) {
+ return "skipping because of namespace " + ns;
+ }
+ }
+ return null;
+ }
+ @Override
+ public String toString() {
+ return "ExcludeBasedOnNamespace[namespaces=" + excludeNamespaces + "]";
+ }
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnType.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnType.java
index f39f567ea..1a9879e80 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnType.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnType.java
@@ -1,83 +1,96 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
+import static edu.cornell.mannlib.vitro.webapp.search.documentBuilding.IndividualToSearchDocument.DONT_EXCLUDE;
+
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Property;
/**
- * Exclude individual from search index if
- * it is a member of any of the the types.
+ * Exclude individual from search index if it is a member of any of the the
+ * types.
+ *
* @author bdc34
- *
+ *
*/
public class ExcludeBasedOnType implements SearchIndexExcluder {
private static final String SKIP_MSG = "skipping due to type.";
-
- /** The add, set and remove methods must keep this list sorted. */
- List typeURIs;
-
- public ExcludeBasedOnType(String ... typeURIs) {
- setExcludedTypes( typeURIs );
- }
- @Override
- public String checkForExclusion(Individual ind) {
- if( ind == null )
- return null;
-
- if( typeURIinExcludeList( ind.getVClass() ))
- return SKIP_MSG;
-
- List vclasses = new ArrayList();
- vclasses.addAll( ind.getVClasses()!=null?ind.getVClasses():Collections.EMPTY_LIST );
- vclasses.addAll( ind.getVClasses(true)!=null?ind.getVClasses(true):Collections.EMPTY_LIST );
-
- for( VClass vclz : vclasses){
- if( typeURIinExcludeList( vclz ))
- return SKIP_MSG;
- }
-
- return null;
- }
-
- protected boolean typeURIinExcludeList( VClass vclz){
- if( vclz != null && vclz.getURI() != null && !vclz.isAnonymous() ){
- int pos = Collections.binarySearch(typeURIs, vclz.getURI());
- return pos >= 0;
- }else{
- return false;
- }
- }
-
- public void setExcludedTypes(String ... typeURIs){
- setExcludedTypes(Arrays.asList(typeURIs));
- }
-
- public void setExcludedTypes(List typeURIs){
- synchronized(this){
- this.typeURIs = new ArrayList(typeURIs) ;
- Collections.sort( this.typeURIs );
- }
- }
-
- protected void addTypeToExclude(String typeURI){
- if( typeURI != null && !typeURI.isEmpty()){
- synchronized(this){
- typeURIs.add(typeURI);
- Collections.sort( this.typeURIs );
- }
- }
- }
-
- protected void removeTypeToExclude(String typeURI){
- synchronized(this){
- typeURIs.remove(typeURI);
- }
- }
+ private final Set typeURIs = new HashSet<>();
+
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#excludes")
+ public void addTypeURI(String uri) {
+ typeURIs.add(uri);
+ }
+
+ @Override
+ public String checkForExclusion(Individual ind) {
+ if (ind == null) {
+ return DONT_EXCLUDE;
+ }
+ if (typeURIinExcludeList(ind.getVClass())) {
+ return SKIP_MSG;
+ }
+
+ List vclasses = new ArrayList<>();
+ addToList(vclasses, ind.getVClasses());
+ addToList(vclasses, ind.getVClasses(true));
+
+ for (VClass vclz : vclasses) {
+ if (typeURIinExcludeList(vclz))
+ return SKIP_MSG;
+ }
+
+ return DONT_EXCLUDE;
+ }
+
+ private void addToList(List list, List additions) {
+ if (additions != null) {
+ list.addAll(additions);
+ }
+ }
+
+ protected boolean typeURIinExcludeList(VClass vclz) {
+ if (vclz != null && vclz.getURI() != null && !vclz.isAnonymous()) {
+ synchronized (typeURIs) {
+ return typeURIs.contains(vclz.getURI());
+ }
+ } else {
+ return false;
+ }
+ }
+
+ protected void setExcludedTypes(List typeURIs) {
+ synchronized (typeURIs) {
+ this.typeURIs.clear();
+ this.typeURIs.addAll(typeURIs);
+ }
+ }
+
+ protected void addTypeToExclude(String typeURI) {
+ if (typeURI != null && !typeURI.isEmpty()) {
+ synchronized (typeURIs) {
+ typeURIs.add(typeURI);
+ }
+ }
+ }
+
+ protected void removeTypeToExclude(String typeURI) {
+ synchronized (typeURIs) {
+ typeURIs.remove(typeURI);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName() + " [typeURIs=" + typeURIs + "]";
+ }
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnTypeNamespace.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnTypeNamespace.java
index 60af4f0bc..671112f28 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnTypeNamespace.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ExcludeBasedOnTypeNamespace.java
@@ -1,34 +1,39 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
-import java.util.Arrays;
-import java.util.Collections;
+import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Property;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Validation;
/**
* Exclude individuals based on the namespaces of their types.
*/
public class ExcludeBasedOnTypeNamespace implements SearchIndexExcluder {
- final List namespaces;
+ private final List namespaces = new ArrayList<>();
Pattern nsRegexPattern;
- public ExcludeBasedOnTypeNamespace(String ... namespaces) {
- super();
- this.namespaces = Collections.unmodifiableList(Arrays.asList( namespaces ));
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#excludes")
+ public void addExcludedNamespace(String uri) {
+ namespaces.add(uri);
+ }
+
+ @Validation
+ public void compileRegexPattern() {
String nsOrPattern = "";
- for( int i=0; i ?label }";
try {
- RDFService rdfService = rsf.getRDFService();
BufferedReader stream =
new BufferedReader(new InputStreamReader(rdfService.sparqlSelectQuery(query, ResultFormat.CSV)));
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/SyncingExcludeBasedOnType.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/SyncingExcludeBasedOnType.java
index dfdf2a28d..c6152126c 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/SyncingExcludeBasedOnType.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/SyncingExcludeBasedOnType.java
@@ -1,12 +1,16 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
+import static edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary.EXCLUDE_CLASS;
+import static edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary.SEARCH_INDEX_URI;
+
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import com.hp.hpl.jena.ontology.OntModel;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryExecution;
import com.hp.hpl.jena.query.QueryExecutionFactory;
@@ -23,25 +27,35 @@ import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.shared.Lock;
-import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
+import edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccess;
+import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.ContextModelsUser;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Validation;
/**
* This excludes based on types defined as EXCLUDE_CLASS in the
* configuration RDF model.
*/
-public class SyncingExcludeBasedOnType extends ExcludeBasedOnType implements ModelChangedListener{
+public class SyncingExcludeBasedOnType extends ExcludeBasedOnType implements ModelChangedListener, ContextModelsUser {
static final Log log = LogFactory.getLog(SyncingExcludeBasedOnType.class);
private static final String queryForProhibitedClasses =
"SELECT ?prohibited WHERE{" +
- "?searchConfig <" + DisplayVocabulary.EXCLUDE_CLASS + "> ?prohibited . " +
+ "?searchConfig <" + EXCLUDE_CLASS + "> ?prohibited . " +
"}";
- String searchIndexURI = DisplayVocabulary.SEARCH_INDEX_URI;
-
- public SyncingExcludeBasedOnType( Model model){
- this.setExcludedTypes( buildProhibitedClassesList(searchIndexURI, model) );
- log.info("types excluded from search: " + typeURIs);
+ private ContextModelAccess models;
+
+ @Override
+ public void setContextModels(ContextModelAccess models) {
+ this.models = models;
+ }
+
+ @Validation
+ public void buildClassList( ){
+ OntModel model = models.getOntModel(ModelNames.DISPLAY);
+ this.setExcludedTypes( buildProhibitedClassesList(SEARCH_INDEX_URI, model) );
+ log.debug(this);
}
private List buildProhibitedClassesList( String URI, Model model){
@@ -81,10 +95,10 @@ public class SyncingExcludeBasedOnType extends ExcludeBasedOnType implements Mod
public void addedStatement(Statement s) {
try{
if( isExcludeClassPredicate( s ) && isAboutSearchIndex(s)){
- if( s.getObject() != null && s.getObject().canAs(Resource.class)){
- String classURI = ((Resource)s.getObject().as(Resource.class)).getURI();
+ if( s.getObject() != null && s.getObject().isURIResource()){
+ String classURI = s.getObject().asResource().getURI();
this.addTypeToExclude(classURI);
- log.debug("prohibited classes: " + this.typeURIs);
+ log.debug("prohibited classes: " + this);
}
}
}catch(Exception ex){
@@ -97,10 +111,10 @@ public class SyncingExcludeBasedOnType extends ExcludeBasedOnType implements Mod
public void removedStatement(Statement s) {
try{
if( isExcludeClassPredicate( s ) && isAboutSearchIndex(s)){
- if( s.getObject() != null && s.getObject().canAs(Resource.class)){
- String classURI = ((Resource)s.getObject().as(Resource.class)).getURI();
+ if( s.getObject() != null && s.getObject().isURIResource()){
+ String classURI = s.getObject().asResource().getURI();
this.removeTypeToExclude(classURI);
- log.debug("prohibited classes: " + this.typeURIs);
+ log.debug("prohibited classes: " + this);
}
}
}catch(Exception ex){
@@ -111,13 +125,13 @@ public class SyncingExcludeBasedOnType extends ExcludeBasedOnType implements Mod
private boolean isExcludeClassPredicate(Statement s){
return s != null
&& s.getPredicate() != null
- && DisplayVocabulary.EXCLUDE_CLASS.getURI().equals( s.getPredicate().getURI());
+ && EXCLUDE_CLASS.getURI().equals( s.getPredicate().getURI());
}
private boolean isAboutSearchIndex(Statement s){
if( s.getSubject() != null ){
- String subURI = ((Resource) s.getSubject()).getURI() ;
- return this.searchIndexURI.equals(subURI);
+ String subURI = s.getSubject().getURI() ;
+ return SEARCH_INDEX_URI.equals(subURI);
}else{
return false;
}
@@ -152,10 +166,9 @@ public class SyncingExcludeBasedOnType extends ExcludeBasedOnType implements Mod
@Override
public void addedStatements(Model model) {
if( model != null){
- addedStatements(model.listStatements(
- model.createResource(searchIndexURI),
- DisplayVocabulary.EXCLUDE_CLASS,
- (RDFNode)null));
+ addedStatements(model.listStatements(
+ model.createResource(SEARCH_INDEX_URI), EXCLUDE_CLASS,
+ (RDFNode) null));
}
}
@@ -193,10 +206,9 @@ public class SyncingExcludeBasedOnType extends ExcludeBasedOnType implements Mod
@Override
public void removedStatements(Model model) {
if( model != null){
- removedStatements(model.listStatements(
- model.createResource(searchIndexURI),
- DisplayVocabulary.EXCLUDE_CLASS,
- (RDFNode)null));
+ removedStatements(model.listStatements(
+ model.createResource(SEARCH_INDEX_URI), EXCLUDE_CLASS,
+ (RDFNode) null));
}
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURL.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURL.java
index a82b3a661..e99db5916 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURL.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURL.java
@@ -15,12 +15,13 @@ import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.rdf.model.RDFNode;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
+import edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccess;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.ContextModelsUser;
-public class ThumbnailImageURL implements DocumentModifier {
+public class ThumbnailImageURL implements DocumentModifier, ContextModelsUser {
private static final String PREFIX = "prefix owl: "
+ " prefix vitroDisplay: "
@@ -36,12 +37,12 @@ public class ThumbnailImageURL implements DocumentModifier {
+ " ?uri ?a . "
+ " ?a ?downloadLocation . } ";
- private RDFServiceFactory rsf;
+ private RDFService rdf;
private Log log = LogFactory.getLog(ThumbnailImageURL.class);
-
- public ThumbnailImageURL( RDFServiceFactory rsf ){
- this.rsf = rsf;
+ @Override
+ public void setContextModels(ContextModelAccess models) {
+ this.rdf = models.getRDFService();
}
@Override
@@ -71,7 +72,6 @@ public class ThumbnailImageURL implements DocumentModifier {
String uri = "<" + individual.getURI() + "> ";
String query = QUERY_TEMPLATE.replaceAll("\\?uri", uri);
- RDFService rdf = rsf.getRDFService();
try{
ResultSet results = RDFServiceUtils.sparqlSelectQuery(query, rdf);
while(results.hasNext()){
@@ -89,8 +89,6 @@ public class ThumbnailImageURL implements DocumentModifier {
}
}catch(Throwable t){
log.error(t,t);
- } finally{
- rdf.close();
}
return result.toString();
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/searchengine/InstrumentedSearchEngineWrapper.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/searchengine/InstrumentedSearchEngineWrapper.java
index 137506630..e4e88bbed 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/searchengine/InstrumentedSearchEngineWrapper.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/searchengine/InstrumentedSearchEngineWrapper.java
@@ -18,6 +18,8 @@ import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngineExcepti
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchQuery;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchResponse;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Property;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Validation;
/**
* Manages the life-cycle of the SearchEngine. Adds logging, controlled by
@@ -27,17 +29,30 @@ public class InstrumentedSearchEngineWrapper implements SearchEngine {
private static final Log log = LogFactory
.getLog(InstrumentedSearchEngineWrapper.class);
- private final SearchEngine innerEngine;
+ private SearchEngine innerEngine;
private volatile LifecycleState lifecycleState = NEW;
- public InstrumentedSearchEngineWrapper(SearchEngine innerEngine) {
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#wraps")
+ public void setInnerEngine(SearchEngine inner) {
if (innerEngine == null) {
- throw new NullPointerException("innerEngine may not be null.");
+ innerEngine = inner;
+ } else {
+ throw new IllegalStateException(
+ "Configuration includes multiple SearchEngine instancess: "
+ + innerEngine + ", and " + inner);
}
- this.innerEngine = innerEngine;
}
+ @Validation
+ public void validate() throws Exception {
+ if (innerEngine == null) {
+ throw new IllegalStateException(
+ "Configuration did not include a wrapped SearchEngine.");
+ }
+ }
+
+
/**
* Complain unless ACTIVE.
*/
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/searchindex/SearchIndexerSetup.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/searchindex/SearchIndexerSetup.java
index 6e742499b..19738057d 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/searchindex/SearchIndexerSetup.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/searchindex/SearchIndexerSetup.java
@@ -6,17 +6,18 @@ import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames.DISPLAY;
import java.util.ArrayList;
import java.util.List;
+import java.util.Set;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import com.hp.hpl.jena.ontology.OntModel;
-import com.hp.hpl.jena.rdf.model.Model;
-import com.hp.hpl.jena.vocabulary.OWL;
import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
-import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
import edu.cornell.mannlib.vitro.webapp.dao.filtering.WebappDaoFactoryFiltering;
import edu.cornell.mannlib.vitro.webapp.dao.filtering.filters.VitroFilterUtils;
@@ -25,25 +26,18 @@ import edu.cornell.mannlib.vitro.webapp.dao.jena.ModelContext;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngine;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils;
import edu.cornell.mannlib.vitro.webapp.search.SearchIndexer;
import edu.cornell.mannlib.vitro.webapp.search.beans.StatementToURIsToUpdate;
import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier;
-import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ExcludeBasedOnNamespace;
-import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ExcludeBasedOnType;
-import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ExcludeBasedOnTypeNamespace;
-import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ExcludeNonFlagVitro;
import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.IndividualToSearchDocument;
-import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.NameBoost;
-import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.NameFields;
import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.SearchIndexExcluder;
-import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.SyncingExcludeBasedOnType;
-import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ThumbnailImageURL;
import edu.cornell.mannlib.vitro.webapp.search.indexing.AdditionalUriFinders;
import edu.cornell.mannlib.vitro.webapp.search.indexing.IndexBuilder;
import edu.cornell.mannlib.vitro.webapp.search.indexing.SearchReindexingListener;
import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.ConfigurationBeanLoader;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.ConfigurationBeanLoaderException;
import edu.cornell.mannlib.vitro.webapp.utils.developer.Key;
import edu.cornell.mannlib.vitro.webapp.utils.developer.listeners.DeveloperDisabledModelChangeListener;
@@ -51,63 +45,26 @@ import edu.cornell.mannlib.vitro.webapp.utils.developer.listeners.DeveloperDisab
* TODO
*/
public class SearchIndexerSetup implements ServletContextListener {
+ private static final Log log = LogFactory.getLog(SearchIndexerSetup.class);
+
public static final String PROHIBITED_FROM_SEARCH = "edu.cornell.mannlib.vitro.webapp.search.beans.ProhibitedFromSearch";
-
- /**
- * Exclude from the search index Individuals with types from these
- * namespaces
- */
- private static final String[] TYPE_NS_EXCLUDES = { VitroVocabulary.PUBLIC
- // if you do OWL.NS here you will exclude all of owl:Thing.
- };
-
- /**
- * Exclude from the search index individuals who's URIs start with these
- * namespaces.
- */
- private static final String[] INDIVIDUAL_NS_EXCLUDES = {
- VitroVocabulary.vitroURI, VitroVocabulary.VITRO_PUBLIC,
- VitroVocabulary.PSEUDO_BNODE_NS, OWL.NS };
-
- /** Individuals of these types will be excluded from the search index */
- private static final String[] OWL_TYPES_EXCLUDES = {
- OWL.ObjectProperty.getURI(), OWL.DatatypeProperty.getURI(),
- OWL.AnnotationProperty.getURI() };
+
+ private ServletContext ctx;
+ private OntModel displayModel;
+ private ConfigurationBeanLoader beanLoader;
@Override
public void contextInitialized(ServletContextEvent sce) {
+ this.ctx = sce.getServletContext();
+ this.displayModel = ModelAccess.on(ctx).getOntModel(DISPLAY);
+ this.beanLoader = new ConfigurationBeanLoader(displayModel, ctx);
+
ServletContext context = sce.getServletContext();
StartupStatus ss = StartupStatus.getBean(context);
SearchEngine searchEngine = ApplicationUtils.instance().getSearchEngine();
try {
- /* set up the individual to search doc translation */
- OntModel jenaOntModel = ModelAccess.on(context).getOntModel();
- OntModel displayModel = ModelAccess.on(context).getOntModel(DISPLAY);
-
- /*
- * try to get context attribute DocumentModifiers and use that as
- * the start of the list of DocumentModifier objects. This allows
- * other ContextListeners to add to the basic set of
- * DocumentModifiers.
- */
- @SuppressWarnings("unchecked")
- List modifiersFromContext = (List) context
- .getAttribute("DocumentModifiers");
-
- /*
- * try to get context attribute SearchIndexExcludes and use that as
- * the start of the list of exclude objects. This allows other
- * ContextListeners to add to the basic set of SearchIndexExcludes .
- */
- @SuppressWarnings("unchecked")
- List searchIndexExcludesFromContext = (List) context
- .getAttribute("SearchIndexExcludes");
-
- IndividualToSearchDocument indToSearchDoc = setupTranslation(
- jenaOntModel, displayModel,
- RDFServiceUtils.getRDFServiceFactory(context),
- modifiersFromContext, searchIndexExcludesFromContext);
+ IndividualToSearchDocument indToSearchDoc = setupTranslation();
/* setup search indexer */
SearchIndexer searchIndexer = new SearchIndexer(searchEngine, indToSearchDoc);
@@ -156,42 +113,17 @@ public class SearchIndexerSetup implements ServletContextListener {
}
- public static IndividualToSearchDocument setupTranslation(
- OntModel jenaOntModel, Model displayModel,
- RDFServiceFactory rdfServiceFactory,
- List modifiersFromContext,
- List searchIndexExcludesFromContext) {
+ private IndividualToSearchDocument setupTranslation() {
+ try {
+ Set excluders = beanLoader.loadAll(SearchIndexExcluder.class);
+ log.debug("Excludes: (" + excluders.size() + ") " + excluders);
- /*
- * try to get context attribute DocumentModifiers and use that as the
- * start of the list of DocumentModifier objects. This allows other
- * ContextListeners to add to the basic set of DocumentModifiers.
- */
- List modifiers = new ArrayList();
- if (modifiersFromContext != null) {
- modifiers.addAll(modifiersFromContext);
+ Set modifiers = beanLoader.loadAll(DocumentModifier.class);
+ log.debug("Modifiers: (" + modifiers.size() + ") " + modifiers);
+
+ return new IndividualToSearchDocument(new ArrayList<>(excluders), new ArrayList<>(modifiers));
+ } catch (ConfigurationBeanLoaderException e) {
+ throw new RuntimeException("Failed to configure the SearchIndexer", e);
}
-
- modifiers.add(new NameFields(rdfServiceFactory));
- modifiers.add(new NameBoost(1.2f));
- modifiers.add(new ThumbnailImageURL(rdfServiceFactory));
-
- /*
- * try to get context attribute SearchIndexExcludes and use that as the
- * start of the list of exclude objects. This allows other
- * ContextListeners to add to the basic set of SearchIndexExcludes .
- */
- List excludes = new ArrayList();
- if (searchIndexExcludesFromContext != null) {
- excludes.addAll(searchIndexExcludesFromContext);
- }
-
- excludes.add(new ExcludeBasedOnNamespace(INDIVIDUAL_NS_EXCLUDES));
- excludes.add(new ExcludeBasedOnTypeNamespace(TYPE_NS_EXCLUDES));
- excludes.add(new ExcludeBasedOnType(OWL_TYPES_EXCLUDES));
- excludes.add(new ExcludeNonFlagVitro());
- excludes.add(new SyncingExcludeBasedOnType(displayModel));
-
- return new IndividualToSearchDocument(excludes, modifiers);
}
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/ConfigurationModelsSetup.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/ConfigurationModelsSetup.java
index b195f65eb..e728fb7c2 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/ConfigurationModelsSetup.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/ConfigurationModelsSetup.java
@@ -52,13 +52,12 @@ public class ConfigurationModelsSetup implements ServletContextListener {
private void loadFirstTimeFiles(ServletContext ctx, String modelPath,
OntModel baseModel) {
- RDFFilesLoader.loadFirstTimeFiles(ctx, modelPath, baseModel,
- baseModel.isEmpty());
+ RDFFilesLoader.loadFirstTimeFiles(modelPath, baseModel, baseModel.isEmpty());
}
private void loadEveryTimeFiles(ServletContext ctx, String modelPath,
OntModel memoryModel) {
- RDFFilesLoader.loadEveryTimeFiles(ctx, modelPath, memoryModel);
+ RDFFilesLoader.loadEveryTimeFiles(modelPath, memoryModel);
}
@Override
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/ContentModelSetup.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/ContentModelSetup.java
index 2f8eb399c..3919aa069 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/ContentModelSetup.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/ContentModelSetup.java
@@ -62,13 +62,13 @@ public class ContentModelSetup extends JenaDataSourceSetupBase
if (isFirstStartup()) {
initializeApplicationMetadata(ctx, applicationMetadataModel);
- RDFFilesLoader.loadFirstTimeFiles(ctx, "abox", baseABoxModel, true);
- RDFFilesLoader.loadFirstTimeFiles(ctx, "tbox", baseTBoxModel, true);
+ RDFFilesLoader.loadFirstTimeFiles("abox", baseABoxModel, true);
+ RDFFilesLoader.loadFirstTimeFiles("tbox", baseTBoxModel, true);
} else {
checkForNamespaceMismatch( applicationMetadataModel, ctx );
}
- RDFFilesLoader.loadEveryTimeFiles(ctx, "abox", baseABoxModel);
- RDFFilesLoader.loadEveryTimeFiles(ctx, "tbox", baseTBoxModel);
+ RDFFilesLoader.loadEveryTimeFiles("abox", baseABoxModel);
+ RDFFilesLoader.loadEveryTimeFiles("tbox", baseTBoxModel);
log.info("Setting up DAO factories");
}
@@ -89,7 +89,7 @@ public class ContentModelSetup extends JenaDataSourceSetupBase
private void initializeApplicationMetadata(ServletContext ctx,
Model applicationMetadataModel) {
OntModel temporaryAMModel = VitroModelFactory.createOntologyModel();
- RDFFilesLoader.loadFirstTimeFiles(ctx, "applicationMetadata", temporaryAMModel, true);
+ RDFFilesLoader.loadFirstTimeFiles("applicationMetadata", temporaryAMModel, true);
setPortalUriOnFirstTime(temporaryAMModel, ctx);
applicationMetadataModel.add(temporaryAMModel);
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/FileGraphSetup.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/FileGraphSetup.java
index 402804e63..4fbd5d8c2 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/FileGraphSetup.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/FileGraphSetup.java
@@ -31,10 +31,9 @@ import com.hp.hpl.jena.ontology.OntModelSpec;
import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
-import com.hp.hpl.jena.rdf.model.ModelMaker;
-import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
-import edu.cornell.mannlib.vitro.webapp.dao.jena.BlankNodeFilteringModelMaker;
+import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
+import edu.cornell.mannlib.vitro.webapp.dao.jena.RDFServiceDataset;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelNames;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
@@ -49,7 +48,6 @@ public class FileGraphSetup implements ServletContextListener {
private static final String ABOX = "abox";
private static final String TBOX = "tbox";
private static final String FILEGRAPH = "filegraph";
- private static final String PROPERTY_VITRO_HOME = "vitro.home";
public static final String FILEGRAPH_URI_ROOT = "http://vitro.mannlib.cornell.edu/filegraph/";
@@ -73,8 +71,6 @@ public class FileGraphSetup implements ServletContextListener {
OntDocumentManager.getInstance().setProcessImports(true);
Dataset dataset = ModelAccess.on(ctx).getDataset();
RDFService rdfService = ModelAccess.on(ctx).getRDFService(CONTENT);
- ModelMaker modelMaker = new BlankNodeFilteringModelMaker(
- rdfService, ModelAccess.on(ctx).getModelMaker(CONTENT));
// ABox files
Set paths = getFilegraphPaths(ctx, RDF, ABOX, FILEGRAPH);
@@ -82,7 +78,7 @@ public class FileGraphSetup implements ServletContextListener {
cleanupDB(dataset, pathsToURIs(paths, ABOX), ABOX);
// Just update the ABox filegraphs in the DB; don't attach them to a base model.
- aboxChanged = readGraphs(paths, modelMaker, ABOX, /* aboxBaseModel */ null);
+ aboxChanged = readGraphs(paths, rdfService, ABOX, /* aboxBaseModel */ null);
// TBox files
paths = getFilegraphPaths(ctx, RDF, TBOX, FILEGRAPH);
@@ -90,7 +86,7 @@ public class FileGraphSetup implements ServletContextListener {
cleanupDB(dataset, pathsToURIs(paths, TBOX),TBOX);
OntModel tboxBaseModel = ModelAccess.on(ctx).getOntModel(ModelNames.TBOX_ASSERTIONS);
- tboxChanged = readGraphs(paths, modelMaker, TBOX, tboxBaseModel);
+ tboxChanged = readGraphs(paths, rdfService, TBOX, tboxBaseModel);
} catch (ClassCastException cce) {
String errMsg = "Unable to cast servlet context attribute to the appropriate type " + cce.getLocalizedMessage();
log.error(errMsg);
@@ -118,8 +114,7 @@ public class FileGraphSetup implements ServletContextListener {
private Set getFilegraphPaths(ServletContext ctx, String... strings) {
StartupStatus ss = StartupStatus.getBean(ctx);
- ConfigurationProperties props = ConfigurationProperties.getBean(ctx);
- String homeDirProperty = props.getProperty(PROPERTY_VITRO_HOME);
+ String homeDirProperty = ApplicationUtils.instance().getHomeDirectory().getPath().toString();
Path filegraphDir = Paths.get(homeDirProperty, strings);
Set paths = new TreeSet<>();
@@ -151,7 +146,7 @@ public class FileGraphSetup implements ServletContextListener {
* Note: no connection needs to be maintained between the in-memory copy of the
* graph and the DB copy.
*/
- private boolean readGraphs(Set pathSet, ModelMaker modelMaker, String type, OntModel baseModel) {
+ private boolean readGraphs(Set pathSet, RDFService rdfService, String type, OntModel baseModel) {
int count = 0;
@@ -180,7 +175,7 @@ public class FileGraphSetup implements ServletContextListener {
log.debug("Attached file graph as " + type + " submodel " + p.getFileName());
}
- modelChanged = modelChanged | updateGraphInDB(modelMaker, model, type, p);
+ modelChanged = modelChanged | updateGraphInDB(rdfService, model, type, p);
} catch (Exception ioe) {
log.error("Unable to process file graph " + p, ioe);
@@ -214,21 +209,24 @@ public class FileGraphSetup implements ServletContextListener {
* Otherwise, if a graph with the given name is in the DB and is isomorphic with
* the graph that was read from the files system, then do nothing.
*/
- public boolean updateGraphInDB(ModelMaker modelMaker, Model fileModel, String type, Path path) {
+ public boolean updateGraphInDB(RDFService rdfService, Model fileModel, String type, Path path) {
String graphURI = pathToURI(path,type);
- Model dbModel = modelMaker.getModel(graphURI);
+ Model dbModel = new RDFServiceDataset(rdfService).getNamedModel(graphURI);
boolean modelChanged = false;
log.debug(String.format(
"%s %s dbModel size is %d, fileModel size is %d", type,
path.getFileName(), dbModel.size(), fileModel.size()));
- boolean isIsomorphic = dbModel.isIsomorphicWith(fileModel);
+ // Isomorphism has some quirky issues with TDB, and perhaps also with Virtuoso.
+ boolean isChanged = ApplicationUtils.instance()
+ .getContentTripleSource().getQuirks()
+ .hasFileGraphChanged(fileModel, dbModel, graphURI);
if (dbModel.isEmpty() && !fileModel.isEmpty()) {
dbModel.add(fileModel);
modelChanged = true;
- } else if (!isIsomorphic) {
+ } else if (isChanged) {
log.info("Updating " + path + " because graphs are not isomorphic");
log.info("dbModel: " + dbModel.size() + " ; fileModel: " + fileModel.size());
dbModel.removeAll();
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/RDFFilesLoader.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/RDFFilesLoader.java
index 89b6dbfe6..aa37f3e63 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/RDFFilesLoader.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/RDFFilesLoader.java
@@ -13,8 +13,6 @@ import java.nio.file.Paths;
import java.util.Set;
import java.util.TreeSet;
-import javax.servlet.ServletContext;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -23,7 +21,7 @@ import com.hp.hpl.jena.ontology.OntModelSpec;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
-import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
+import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
/**
* Help to load RDF files on first time and on every startup.
@@ -31,7 +29,6 @@ import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
public class RDFFilesLoader {
private static final Log log = LogFactory.getLog(RDFFilesLoader.class);
- private static final String PROPERTY_VITRO_HOME = "vitro.home";
private static final String DEFAULT_RDF_FORMAT = "RDF/XML";
private static final String RDF = "rdf";
private static final String FIRST_TIME = "firsttime";
@@ -61,10 +58,10 @@ public class RDFFilesLoader {
*
* The files from the directory are added to the model.
*/
- public static void loadFirstTimeFiles(ServletContext ctx, String modelPath,
- Model model, boolean firstTime) {
+ public static void loadFirstTimeFiles(String modelPath, Model model,
+ boolean firstTime) {
if (firstTime) {
- Set paths = getPaths(locateHomeDirectory(ctx), RDF,
+ Set paths = getPaths(locateHomeDirectory(), RDF,
modelPath, FIRST_TIME);
for (Path p : paths) {
readOntologyFileIntoModel(p, model);
@@ -83,11 +80,10 @@ public class RDFFilesLoader {
*
* The files from the directory become a sub-model of the model.
*/
- public static void loadEveryTimeFiles(ServletContext ctx, String modelPath,
- OntModel model) {
+ public static void loadEveryTimeFiles(String modelPath, OntModel model) {
OntModel everytimeModel = ModelFactory
.createOntologyModel(OntModelSpec.OWL_MEM);
- String home = locateHomeDirectory(ctx);
+ String home = locateHomeDirectory();
Set paths = getPaths(home, RDF, modelPath, EVERY_TIME);
for (Path p : paths) {
log.info("Loading " + relativePath(p, home));
@@ -177,9 +173,9 @@ public class RDFFilesLoader {
return DEFAULT_RDF_FORMAT;
}
- private static String locateHomeDirectory(ServletContext ctx) {
- return ConfigurationProperties.getBean(ctx).getProperty(
- PROPERTY_VITRO_HOME);
+ private static String locateHomeDirectory() {
+ return ApplicationUtils.instance().getHomeDirectory().getPath()
+ .toString();
}
/**
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/UpdateKnowledgeBase.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/UpdateKnowledgeBase.java
index b2482eb94..d7931035e 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/UpdateKnowledgeBase.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/UpdateKnowledgeBase.java
@@ -13,7 +13,6 @@ import java.io.IOException;
import java.io.StringWriter;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -44,6 +43,7 @@ import com.hp.hpl.jena.shared.Lock;
import com.hp.hpl.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS;
+import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayVocabulary;
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
@@ -98,7 +98,7 @@ public class UpdateKnowledgeBase implements ServletContextListener {
settings.setUnionOntModelSelector(ModelAccess.on(ctx).getOntModelSelector());
ConfigurationProperties props = ConfigurationProperties.getBean(ctx);
- Path homeDir = Paths.get(props.getProperty("vitro.home"));
+ Path homeDir = ApplicationUtils.instance().getHomeDirectory().getPath();
settings.setDisplayModel(ModelAccess.on(ctx).getOntModel(DISPLAY));
OntModel oldTBoxModel = loadModelFromDirectory(ctx.getRealPath(OLD_TBOX_MODEL_DIR));
settings.setOldTBoxModel(oldTBoxModel);
@@ -202,8 +202,7 @@ public class UpdateKnowledgeBase implements ServletContextListener {
* Put the paths for the directories and files into the settings object.
*/
private void putReportingPathsIntoSettings(ServletContext ctx, UpdateSettings settings) throws IOException {
- ConfigurationProperties props = ConfigurationProperties.getBean(ctx);
- Path homeDir = Paths.get(props.getProperty("vitro.home"));
+ Path homeDir = ApplicationUtils.instance().getHomeDirectory().getPath();
Path dataDir = createDirectory(homeDir, "upgrade", "knowledgeBase");
settings.setDataDir(dataDir.toString());
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/RDFSetup.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/RDFSetup.java
deleted file mode 100644
index 00fb71fd4..000000000
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/RDFSetup.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup;
-
-import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONFIGURATION;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sparql.ContentDataStructuresProviderSPARQL.PROPERTY_SPARQL_ENDPOINT_URI;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.tdb.ContentDataStructuresProviderTDB.PROPERTY_CONTENT_TDB_PATH;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import com.hp.hpl.jena.ontology.OntDocumentManager;
-
-import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
-import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.BasicDataStructuresProvider;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.ConfigurationDataStructuresProvider;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.ContentDataStructuresProvider;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sparql.ContentDataStructuresProviderSPARQL;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.tdb.ConfigurationDataStructuresProviderTDB;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.tdb.ContentDataStructuresProviderTDB;
-
-/**
- * Create the RDFServiceFactories and ModelMakers for the application to use.
- */
-public class RDFSetup implements ServletContextListener {
- private static final Log log = LogFactory.getLog(RDFSetup.class);
-
- private ServletContext ctx;
- private ConfigurationProperties configProps;
-
- private ContentDataStructuresProvider contentProvider;
- private ConfigurationDataStructuresProvider configurationProvider;
- private BasicDataStructuresProvider provider;
-
- @Override
- public void contextInitialized(ServletContextEvent sce) {
- this.ctx = sce.getServletContext();
- this.configProps = ConfigurationProperties.getBean(ctx);
-
- configureJena();
-
- createProviders();
-
- RDFServiceUtils.setRDFServiceFactory(ctx,
- contentProvider.getRDFServiceFactory());
- RDFServiceUtils.setRDFServiceFactory(ctx,
- configurationProvider.getRDFServiceFactory(), CONFIGURATION);
-
- ModelAccess.setDataStructuresProvider(provider);
- }
-
- private void configureJena() {
- // we do not want to fetch imports when we wrap Models in OntModels
- OntDocumentManager.getInstance().setProcessImports(false);
- }
-
- /**
- * For now, these steps are hard-coded. They should be driven by a
- * configuration file.
- */
- private void createProviders() {
- if (isSparqlEndpointContentConfigured()) {
- contentProvider = new ContentDataStructuresProviderSPARQL(ctx, this);
- } else if (isTdbConfigured()) {
- contentProvider = new ContentDataStructuresProviderTDB(ctx, this);
- } else {
- contentProvider = new ContentDataStructuresProviderSDB(ctx, this);
- }
-
- configurationProvider = new ConfigurationDataStructuresProviderTDB(ctx,
- this);
-
- provider = new BasicDataStructuresProvider(contentProvider,
- configurationProvider);
- }
-
- private boolean isSparqlEndpointContentConfigured() {
- return StringUtils.isNotBlank(configProps
- .getProperty(PROPERTY_SPARQL_ENDPOINT_URI));
- }
-
- private boolean isTdbConfigured() {
- return StringUtils.isNotBlank(configProps
- .getProperty(PROPERTY_CONTENT_TDB_PATH));
- }
-
- @Override
- public void contextDestroyed(ServletContextEvent sce) {
- if (contentProvider != null) {
- try {
- contentProvider.close();
- } catch (Exception e) {
- log.error("Problem when closing content provider", e);
- }
- }
- if (configurationProvider != null) {
- try {
- configurationProvider.close();
- } catch (Exception e) {
- log.error("Problem when closing configuration provider", e);
- }
- }
- }
-
-}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/DataStructuresProvider.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/CombinedTripleSource.java
similarity index 79%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/DataStructuresProvider.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/CombinedTripleSource.java
index bd84e0f0c..c5189a4b4 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/DataStructuresProvider.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/CombinedTripleSource.java
@@ -1,6 +1,6 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup;
+package edu.cornell.mannlib.vitro.webapp.triplesource;
import javax.servlet.http.HttpServletRequest;
@@ -17,11 +17,11 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
*
* Repeated calls for the same data structure should yield the same instance.
*
- * Repeated calls for the ShortTermDataStructuresProvider need not yield the
+ * Repeated calls for the ShortTermCombinedTripleSource need not yield the
* same instance, but must yield an instance that will return the same
* structures as any other instance for the same request.
*/
-public interface DataStructuresProvider {
+public interface CombinedTripleSource {
RDFService getRDFService(WhichService whichService);
Dataset getDataset(WhichService whichService);
@@ -30,6 +30,6 @@ public interface DataStructuresProvider {
OntModelCache getOntModelCache();
- ShortTermDataStructuresProvider getShortTermDataStructuresProvider(
+ ShortTermCombinedTripleSource getShortTermCombinedTripleSource(
HttpServletRequest req);
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/ShortTermDataStructuresProvider.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/ShortTermCombinedTripleSource.java
similarity index 87%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/ShortTermDataStructuresProvider.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/ShortTermCombinedTripleSource.java
index 2b7d1c6ea..f81373dcd 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/ShortTermDataStructuresProvider.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/ShortTermCombinedTripleSource.java
@@ -1,6 +1,6 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup;
+package edu.cornell.mannlib.vitro.webapp.triplesource;
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactoryConfig;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService;
@@ -16,7 +16,7 @@ import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
* Repeated calls for the WebappDaoFactoryConfig need not yield the same
* instance.
*/
-public interface ShortTermDataStructuresProvider {
+public interface ShortTermCombinedTripleSource {
RDFService getRDFService(WhichService whichService);
OntModelCache getOntModelCache();
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/BasicDataStructuresProvider.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/BasicCombinedTripleSource.java
similarity index 72%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/BasicDataStructuresProvider.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/BasicCombinedTripleSource.java
index ab31e1dd4..905dc65a6 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/BasicDataStructuresProvider.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/BasicCombinedTripleSource.java
@@ -1,6 +1,6 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl;
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONFIGURATION;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONTENT;
@@ -27,23 +27,26 @@ import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.ModelMakerOntModel
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.OntModelCache;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.UnionModelsOntModelsCache;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.UnionModelsOntModelsCache.UnionSpec;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ConfigurationTripleSource;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ContentTripleSource;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.TripleSource;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.DataStructuresProvider;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.ShortTermDataStructuresProvider;
+import edu.cornell.mannlib.vitro.webapp.triplesource.CombinedTripleSource;
+import edu.cornell.mannlib.vitro.webapp.triplesource.ShortTermCombinedTripleSource;
import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
/**
- * A simple implementation of DataStructuresProvider.
+ * A simple implementation of CombinedTripleSource.
*
* Note that we don't bother to cache the RDFServices, RDFServiceFactories, and
- * ModelMakers, since the providers can be expected to cache them.
+ * ModelMakers, since the sources can be expected to cache them.
*
* We must cache the OntModelCache because it was created here. If we were to
* recreate it, we would lose any sub-models that had been attached in the
* meantime.
*/
-public class BasicDataStructuresProvider implements DataStructuresProvider {
+public class BasicCombinedTripleSource implements CombinedTripleSource {
/**
* Create union models for ABox and TBox, and full models for assertions and
* inferences. No need to create FULL_UNION, since it's the default model.
@@ -58,16 +61,15 @@ public class BasicDataStructuresProvider implements DataStructuresProvider {
UnionSpec.base(ABOX_INFERENCES).plus(TBOX_INFERENCES)
.yields(FULL_INFERENCES) };
- private final Map providers;
+ private final Map sources;
private final Map ontModels;
private final OntModelCache ontModelCache;
- public BasicDataStructuresProvider(
- SingleSourceDataStructuresProvider contentProvider,
- SingleSourceDataStructuresProvider configurationProvider) {
- providers = new EnumMap<>(WhichService.class);
- providers.put(CONTENT, contentProvider);
- providers.put(CONFIGURATION, configurationProvider);
+ public BasicCombinedTripleSource(ContentTripleSource contentSource,
+ ConfigurationTripleSource configurationSource) {
+ sources = new EnumMap<>(WhichService.class);
+ sources.put(CONTENT, contentSource);
+ sources.put(CONFIGURATION, configurationSource);
ontModels = new EnumMap<>(WhichService.class);
ontModels.put(CONTENT, new ModelMakerOntModelCache(
@@ -85,22 +87,22 @@ public class BasicDataStructuresProvider implements DataStructuresProvider {
}
protected RDFServiceFactory getRDFServiceFactory(WhichService whichService) {
- return providers.get(whichService).getRDFServiceFactory();
+ return sources.get(whichService).getRDFServiceFactory();
}
@Override
public RDFService getRDFService(WhichService whichService) {
- return providers.get(whichService).getRDFService();
+ return sources.get(whichService).getRDFService();
}
@Override
public Dataset getDataset(WhichService whichService) {
- return providers.get(whichService).getDataset();
+ return sources.get(whichService).getDataset();
}
@Override
public ModelMaker getModelMaker(WhichService whichService) {
- return providers.get(whichService).getModelMaker();
+ return sources.get(whichService).getModelMaker();
}
@Override
@@ -109,16 +111,15 @@ public class BasicDataStructuresProvider implements DataStructuresProvider {
}
@Override
- public ShortTermDataStructuresProvider getShortTermDataStructuresProvider(
+ public ShortTermCombinedTripleSource getShortTermCombinedTripleSource(
HttpServletRequest req) {
- return new BasicShortTermDataStructuresProvider(req, this, providers);
+ return new BasicShortTermCombinedTripleSource(req, this, sources);
}
@Override
public String toString() {
- return "BasicDataStructuresProvider[" + ToString.hashHex(this)
- + ", providers=" + providers + ", ontModels=" + ontModelCache
- + "]";
+ return "BasicCombinedTripleSource[" + ToString.hashHex(this)
+ + ", sources=" + sources + ", ontModels=" + ontModelCache + "]";
}
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/BasicShortTermDataStructuresProvider.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/BasicShortTermCombinedTripleSource.java
similarity index 80%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/BasicShortTermDataStructuresProvider.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/BasicShortTermCombinedTripleSource.java
index dae15d633..46f43dce7 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/BasicShortTermDataStructuresProvider.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/BasicShortTermCombinedTripleSource.java
@@ -1,6 +1,6 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl;
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONFIGURATION;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONTENT;
@@ -25,39 +25,39 @@ import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactoryConfig;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.JoinedOntModelCache;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.OntModelCache;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.TripleSource;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.filter.LanguageFilteringUtils;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.ShortTermDataStructuresProvider;
+import edu.cornell.mannlib.vitro.webapp.triplesource.ShortTermCombinedTripleSource;
import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
/**
- * The simple implementation of ShortTermDataStructuresProvider.
+ * The simple implementation of ShortTermCombinedTripleSource.
*
* The short-term RDFServices are cached, lest we somehow create duplicates for
* the same request. Similarly with the short-term OntModels.
*/
-public class BasicShortTermDataStructuresProvider implements
- ShortTermDataStructuresProvider {
+public class BasicShortTermCombinedTripleSource implements
+ ShortTermCombinedTripleSource {
private static final Log log = LogFactory
- .getLog(BasicShortTermDataStructuresProvider.class);
+ .getLog(BasicShortTermCombinedTripleSource.class);
private final HttpServletRequest req;
private final ServletContext ctx;
private final ConfigurationProperties props;
- private final BasicDataStructuresProvider parent;
- private final Map providers;
+ private final BasicCombinedTripleSource parent;
+ private final Map sources;
private final Map rdfServices;
private final OntModelCache ontModelCache;
- public BasicShortTermDataStructuresProvider(
- HttpServletRequest req,
- BasicDataStructuresProvider parent,
- final Map providers) {
+ public BasicShortTermCombinedTripleSource(HttpServletRequest req,
+ BasicCombinedTripleSource parent,
+ final Map sources) {
this.req = req;
this.ctx = req.getSession().getServletContext();
this.props = ConfigurationProperties.getBean(ctx);
this.parent = parent;
- this.providers = providers;
+ this.sources = sources;
this.rdfServices = populateRdfServicesMap();
this.ontModelCache = createOntModelCache();
}
@@ -77,12 +77,12 @@ public class BasicShortTermDataStructuresProvider implements
}
/**
- * Ask each provider what short-term models should mask their long-term
+ * Ask each triple source what short-term models should mask their long-term
* counterparts.
*/
private OntModelCache shortModels(WhichService which) {
- return providers.get(which).getShortTermOntModels(
- rdfServices.get(which), parent.getOntModels(which));
+ return sources.get(which).getShortTermOntModels(rdfServices.get(which),
+ parent.getOntModels(which));
}
@Override
@@ -142,8 +142,8 @@ public class BasicShortTermDataStructuresProvider implements
@Override
public String toString() {
- return "BasicShortTermDataStructuresProvider[" + ToString.hashHex(this)
- + ", req=" + ToString.hashHex(req) + ", providers=" + providers
+ return "BasicShortTermCombinedTripleSource[" + ToString.hashHex(this)
+ + ", req=" + ToString.hashHex(req) + ", sources=" + sources
+ ", ontModels=" + ontModelCache + "]";
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/DefaultTripleStoreQuirks.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/DefaultTripleStoreQuirks.java
new file mode 100644
index 000000000..5365a8bb8
--- /dev/null
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/DefaultTripleStoreQuirks.java
@@ -0,0 +1,19 @@
+/* $This file is distributed under the terms of the license in /doc/license.txt$ */
+
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl;
+
+import com.hp.hpl.jena.rdf.model.Model;
+
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.TripleStoreQuirks;
+
+/**
+ * The behavior for non-quirky TripleSource implementations.
+ */
+public class DefaultTripleStoreQuirks implements TripleStoreQuirks {
+
+ @Override
+ public boolean hasFileGraphChanged(Model fromFile, Model previous, String graphURI) {
+ return !fromFile.isIsomorphicWith(previous);
+ }
+
+}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sdb/ContentDataStructuresProviderSDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/ContentTripleSourceSDB.java
similarity index 83%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sdb/ContentDataStructuresProviderSDB.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/ContentTripleSourceSDB.java
index 2bd411900..33feb8a73 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sdb/ContentDataStructuresProviderSDB.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/ContentTripleSourceSDB.java
@@ -1,14 +1,13 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb;
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.BasicDataStructuresProvider.CONTENT_UNIONS;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.BasicCombinedTripleSource.CONTENT_UNIONS;
import java.sql.SQLException;
import java.util.Arrays;
import javax.servlet.ServletContext;
-import javax.servlet.ServletContextListener;
import javax.sql.DataSource;
import org.apache.commons.logging.Log;
@@ -36,13 +35,16 @@ import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.MaskingOntModelCac
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.ModelMakerOntModelCache;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.OntModelCache;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.UnionModelsOntModelsCache;
+import edu.cornell.mannlib.vitro.webapp.modules.Application;
+import edu.cornell.mannlib.vitro.webapp.modules.ComponentStartupStatus;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ContentTripleSource;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.TripleStoreQuirks;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.sdb.RDFServiceFactorySDB;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.logging.LoggingRDFServiceFactory;
import edu.cornell.mannlib.vitro.webapp.servlet.setup.JenaDataSourceSetupBase;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.ContentDataStructuresProvider;
-import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
+import edu.cornell.mannlib.vitro.webapp.triplesource.impl.DefaultTripleStoreQuirks;
import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
/**
@@ -51,10 +53,9 @@ import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
* Do some smoke-tests on the parameters, create the connection pool, and create
* the RDFServiceFactory.
*/
-public class ContentDataStructuresProviderSDB extends
- ContentDataStructuresProvider {
+public class ContentTripleSourceSDB extends ContentTripleSource {
private static final Log log = LogFactory
- .getLog(ContentDataStructuresProviderSDB.class);
+ .getLog(ContentTripleSourceSDB.class);
static final String PROPERTY_DB_URL = "VitroConnection.DataSource.url";
static final String PROPERTY_DB_USERNAME = "VitroConnection.DataSource.username";
@@ -77,33 +78,31 @@ public class ContentDataStructuresProviderSDB extends
static final boolean DEFAULT_TESTONBORROW = true;
static final boolean DEFAULT_TESTONRETURN = true;
+
+ private final TripleStoreQuirks quirks = new DefaultTripleStoreQuirks();
- private final ServletContext ctx;
- private final StartupStatus ss;
- private final ComboPooledDataSource ds;
- private final RDFServiceFactory rdfServiceFactory;
- private final RDFService rdfService;
- private final Dataset dataset;
- private final ModelMaker modelMaker;
+ private ServletContext ctx;
+ private ComboPooledDataSource ds;
+ private RDFServiceFactory rdfServiceFactory;
+ private RDFService rdfService;
+ private Dataset dataset;
+ private ModelMaker modelMaker;
- public ContentDataStructuresProviderSDB(ServletContext ctx,
- ServletContextListener ctxListener) {
+ @Override
+ public void startup(Application application, ComponentStartupStatus ss) {
try {
- this.ctx = ctx;
- this.ss = StartupStatus.getBean(ctx);
+ this.ctx = application.getServletContext();
configureSDBContext();
- new SDBConnectionSmokeTests(ctx, ctxListener)
- .checkDatabaseConnection();
+ new SDBConnectionSmokeTests(ctx, ss).checkDatabaseConnection();
this.ds = new SDBDataSource(ctx).getDataSource();
this.rdfServiceFactory = createRdfServiceFactory();
this.rdfService = rdfServiceFactory.getRDFService();
this.dataset = new RDFServiceDataset(this.rdfService);
this.modelMaker = createModelMaker();
- ss.info(ctxListener,
- "Initialized the content data structures for SDB");
+ ss.info("Initialized the content data structures for SDB");
} catch (SQLException e) {
throw new RuntimeException(
"Failed to set up the content data structures for SDB", e);
@@ -211,16 +210,20 @@ public class ContentDataStructuresProviderSDB extends
}
@Override
- public void close() {
+ public TripleStoreQuirks getQuirks() {
+ return quirks;
+ }
+
+ @Override
+ public String toString() {
+ return "ContentTripleSourceSDB[" + ToString.hashHex(this) + "]";
+ }
+
+ @Override
+ public void shutdown(Application application) {
if (ds != null) {
ds.close();
}
}
- @Override
- public String toString() {
- return "ContentDataStructuresProviderSDB[" + ToString.hashHex(this)
- + "]";
- }
-
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sdb/SDBConnectionSmokeTests.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBConnectionSmokeTests.java
similarity index 66%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sdb/SDBConnectionSmokeTests.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBConnectionSmokeTests.java
index b1eedcb00..c9c9ad4c1 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sdb/SDBConnectionSmokeTests.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBConnectionSmokeTests.java
@@ -1,13 +1,13 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb;
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.DEFAULT_DRIVER_CLASS;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_DRIVER_CLASS_NAME;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_PASSWORD;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_TYPE;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_URL;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_USERNAME;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.DEFAULT_DRIVER_CLASS;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_DRIVER_CLASS_NAME;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_PASSWORD;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_TYPE;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_URL;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_USERNAME;
import java.io.UnsupportedEncodingException;
import java.sql.Connection;
@@ -19,10 +19,9 @@ import java.sql.Statement;
import java.util.Properties;
import javax.servlet.ServletContext;
-import javax.servlet.ServletContextListener;
import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
-import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
+import edu.cornell.mannlib.vitro.webapp.modules.ComponentStartupStatus;
/**
* Smoke tests for the database connection that SDB will use.
@@ -38,38 +37,31 @@ import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
* encoding. Don't know how well this works.
*/
public class SDBConnectionSmokeTests {
- private final ServletContextListener parent;
private final ConfigurationProperties props;
- private final StartupStatus ss;
+ private final ComponentStartupStatus ss;
- public SDBConnectionSmokeTests(ServletContext ctx,
- ServletContextListener parent) {
- this.parent = parent;
+ public SDBConnectionSmokeTests(ServletContext ctx, ComponentStartupStatus ss) {
this.props = ConfigurationProperties.getBean(ctx);
- this.ss = StartupStatus.getBean(ctx);
-
+ this.ss = ss;
}
public void checkDatabaseConnection() {
String url = props.getProperty(PROPERTY_DB_URL);
if (url == null || url.isEmpty()) {
- ss.fatal(parent,
- "runtime.properties does not contain a value for '"
- + PROPERTY_DB_URL + "'");
+ ss.fatal("runtime.properties does not contain a value for '"
+ + PROPERTY_DB_URL + "'");
return;
}
String username = props.getProperty(PROPERTY_DB_USERNAME);
if (username == null || username.isEmpty()) {
- ss.fatal(parent,
- "runtime.properties does not contain a value for '"
- + PROPERTY_DB_USERNAME + "'");
+ ss.fatal("runtime.properties does not contain a value for '"
+ + PROPERTY_DB_USERNAME + "'");
return;
}
String password = props.getProperty(PROPERTY_DB_PASSWORD);
if (password == null || password.isEmpty()) {
- ss.fatal(parent,
- "runtime.properties does not contain a value for '"
- + PROPERTY_DB_PASSWORD + "'");
+ ss.fatal("runtime.properties does not contain a value for '"
+ + PROPERTY_DB_PASSWORD + "'");
return;
}
@@ -79,16 +71,16 @@ public class SDBConnectionSmokeTests {
try {
Class.forName(DEFAULT_DRIVER_CLASS).newInstance();
} catch (Exception e) {
- ss.fatal(parent, "The default Database Driver failed to load. "
- + "The driver class is '" + DEFAULT_DRIVER_CLASS
- + "'", e);
+ ss.fatal("The default Database Driver failed to load. "
+ + "The driver class is '" + DEFAULT_DRIVER_CLASS + "'",
+ e);
return;
}
} else {
try {
Class.forName(driverClassName).newInstance();
} catch (Exception e) {
- ss.fatal(parent, "The Database Driver failed to load. "
+ ss.fatal("The Database Driver failed to load. "
+ "The driver class was set by "
+ PROPERTY_DB_DRIVER_CLASS_NAME + " to be '"
+ driverClassName + "'", e);
@@ -104,9 +96,9 @@ public class SDBConnectionSmokeTests {
.getConnection(url, connectionProps)) {
// Just open the connection and close it.
} catch (SQLException e) {
- ss.fatal(parent, "Can't connect to the database: "
- + PROPERTY_DB_URL + "='" + url + "', "
- + PROPERTY_DB_USERNAME + "='" + username + "'", e);
+ ss.fatal("Can't connect to the database: " + PROPERTY_DB_URL + "='"
+ + url + "', " + PROPERTY_DB_USERNAME + "='" + username
+ + "'", e);
return;
}
@@ -151,15 +143,14 @@ public class SDBConnectionSmokeTests {
+ "set on the database?";
if ("MySQL".equals(dbType)) {
// For MySQL, we know that this is a configuration problem.
- ss.fatal(parent, message);
+ ss.fatal(message);
} else {
// For other databases, it might not be.
- ss.warning(parent, message);
+ ss.warning(message);
}
}
} catch (SQLException e) {
- ss.fatal(parent, "Failed to check handling of Unicode characters",
- e);
+ ss.fatal("Failed to check handling of Unicode characters", e);
}
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sdb/SDBDataSource.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBDataSource.java
similarity index 60%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sdb/SDBDataSource.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBDataSource.java
index d842fd623..f112075ff 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sdb/SDBDataSource.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBDataSource.java
@@ -1,23 +1,23 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb;
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.DEFAULT_DRIVER_CLASS;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.DEFAULT_MAXACTIVE;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.DEFAULT_MAXIDLE;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.DEFAULT_TESTONBORROW;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.DEFAULT_TESTONRETURN;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.DEFAULT_TYPE;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.DEFAULT_VALIDATION_QUERY;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.MINIMUM_MAXACTIVE;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_DRIVER_CLASS_NAME;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_MAX_ACTIVE;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_MAX_IDLE;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_PASSWORD;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_TYPE;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_URL;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_USERNAME;
-import static edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sdb.ContentDataStructuresProviderSDB.PROPERTY_DB_VALIDATION_QUERY;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.DEFAULT_DRIVER_CLASS;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.DEFAULT_MAXACTIVE;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.DEFAULT_MAXIDLE;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.DEFAULT_TESTONBORROW;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.DEFAULT_TESTONRETURN;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.DEFAULT_TYPE;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.DEFAULT_VALIDATION_QUERY;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.MINIMUM_MAXACTIVE;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_DRIVER_CLASS_NAME;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_MAX_ACTIVE;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_MAX_IDLE;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_PASSWORD;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_TYPE;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_URL;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_USERNAME;
+import static edu.cornell.mannlib.vitro.webapp.triplesource.impl.sdb.ContentTripleSourceSDB.PROPERTY_DB_VALIDATION_QUERY;
import java.beans.PropertyVetoException;
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sparql/ContentDataStructuresProviderSPARQL.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sparql/ContentTripleSourceSPARQL.java
similarity index 56%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sparql/ContentDataStructuresProviderSPARQL.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sparql/ContentTripleSourceSPARQL.java
index a0917dae6..70d7c2cce 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/sparql/ContentDataStructuresProviderSPARQL.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sparql/ContentTripleSourceSPARQL.java
@@ -1,26 +1,27 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.sparql;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextListener;
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl.sparql;
import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.rdf.model.ModelMaker;
-import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
import edu.cornell.mannlib.vitro.webapp.dao.jena.RDFServiceDataset;
import edu.cornell.mannlib.vitro.webapp.dao.jena.RDFServiceModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.adapters.ListCachingModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.adapters.MemoryMappingModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.OntModelCache;
+import edu.cornell.mannlib.vitro.webapp.modules.Application;
+import edu.cornell.mannlib.vitro.webapp.modules.ComponentStartupStatus;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ContentTripleSource;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.TripleStoreQuirks;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceFactorySingle;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.logging.LoggingRDFServiceFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.sparql.RDFServiceSparql;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.ContentDataStructuresProvider;
-import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
+import edu.cornell.mannlib.vitro.webapp.triplesource.impl.DefaultTripleStoreQuirks;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Property;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Validation;
import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
/**
@@ -33,44 +34,61 @@ import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
*
* Memory-map the small content models, and add the standard decorators.
*/
-public class ContentDataStructuresProviderSPARQL extends
- ContentDataStructuresProvider {
- public static final String PROPERTY_SPARQL_ENDPOINT_URI = "VitroConnection.DataSource.endpointURI";
- public static final String PROPERTY_SPARQL_UPDATE_ENDPOINT_URI = "VitroConnection.DataSource.updateEndpointURI";
+public class ContentTripleSourceSPARQL extends ContentTripleSource {
+ private String endpointURI;
+ private String updateEndpointURI; // Optional
+
+ private final TripleStoreQuirks quirks = new DefaultTripleStoreQuirks();
- private final ServletContextListener ctxListener;
- private final ConfigurationProperties props;
- private final StartupStatus ss;
- private final String endpointURI;
- private final String updateEndpointURI;
+ private RDFService rdfService;
+ private RDFServiceFactory rdfServiceFactory;
+ private Dataset dataset;
+ private ModelMaker modelMaker;
- private final RDFService rdfService;
- private final RDFServiceFactory rdfServiceFactory;
- private final Dataset dataset;
- private final ModelMaker modelMaker;
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasEndpointURI")
+ public void setEndpointURI(String eUri) {
+ if (endpointURI == null) {
+ endpointURI = eUri;
+ } else {
+ throw new IllegalStateException(
+ "Configuration includes multiple instances of EndpointURI: "
+ + endpointURI + ", and " + eUri);
+ }
+ }
- public ContentDataStructuresProviderSPARQL(ServletContext ctx,
- ServletContextListener ctxListener) {
- this.ctxListener = ctxListener;
- this.props = ConfigurationProperties.getBean(ctx);
- this.ss = StartupStatus.getBean(ctx);
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasUpdateEndpointURI")
+ public void setUpdateEndpointURI(String ueUri) {
+ if (updateEndpointURI == null) {
+ updateEndpointURI = ueUri;
+ } else {
+ throw new IllegalStateException(
+ "Configuration includes multiple instances of UpdateEndpointURI: "
+ + updateEndpointURI + ", and " + ueUri);
+ }
+ }
- this.endpointURI = props.getProperty(PROPERTY_SPARQL_ENDPOINT_URI);
- this.updateEndpointURI = props
- .getProperty(PROPERTY_SPARQL_UPDATE_ENDPOINT_URI);
+ @Validation
+ public void validate() throws Exception {
+ if (endpointURI == null) {
+ throw new IllegalStateException(
+ "Configuration did not include an EndpointURI.");
+ }
+ }
- this.rdfServiceFactory = createRDFServiceFactory(createRDFService());
+ @Override
+ public void startup(Application application, ComponentStartupStatus ss) {
+ this.rdfServiceFactory = createRDFServiceFactory(createRDFService(ss));
this.rdfService = this.rdfServiceFactory.getRDFService();
this.dataset = createDataset();
this.modelMaker = createModelMaker();
}
- private RDFService createRDFService() {
+ private RDFService createRDFService(ComponentStartupStatus ss) {
if (updateEndpointURI == null) {
- ss.info(ctxListener, "Using endpoint at " + endpointURI);
+ ss.info("Using endpoint at " + endpointURI);
return new RDFServiceSparql(endpointURI);
} else {
- ss.info(ctxListener, "Using read endpoint at " + endpointURI
+ ss.info("Using read endpoint at " + endpointURI
+ " and update endpoint at " + updateEndpointURI);
return new RDFServiceSparql(endpointURI, updateEndpointURI);
}
@@ -119,17 +137,22 @@ public class ContentDataStructuresProviderSPARQL extends
}
@Override
- public void close() {
+ public TripleStoreQuirks getQuirks() {
+ return quirks;
+ }
+
+ @Override
+ public String toString() {
+ return "ContentTripleSourceSPARQL[" + ToString.hashHex(this)
+ + ", endpointURI=" + endpointURI + ", updateEndpointURI="
+ + updateEndpointURI + "]";
+ }
+
+ @Override
+ public void shutdown(Application application) {
if (this.rdfService != null) {
this.rdfService.close();
}
}
- @Override
- public String toString() {
- return "ContentDataStructuresProviderSPARQL[" + ToString.hashHex(this)
- + ", endpointURI=" + endpointURI + ", updateEndpointURI="
- + updateEndpointURI + "]";
- }
-
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/tdb/ConfigurationDataStructuresProviderTDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/tdb/ConfigurationTripleSourceTDB.java
similarity index 57%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/tdb/ConfigurationDataStructuresProviderTDB.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/tdb/ConfigurationTripleSourceTDB.java
index e65363904..cecc0053d 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/tdb/ConfigurationDataStructuresProviderTDB.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/tdb/ConfigurationTripleSourceTDB.java
@@ -1,30 +1,29 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.tdb;
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl.tdb;
-import java.io.File;
import java.io.IOException;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextListener;
+import java.nio.file.Path;
import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.rdf.model.ModelMaker;
import com.hp.hpl.jena.tdb.TDB;
-import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
+import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
import edu.cornell.mannlib.vitro.webapp.dao.jena.RDFServiceDataset;
import edu.cornell.mannlib.vitro.webapp.dao.jena.RDFServiceModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.adapters.ListCachingModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.adapters.MemoryMappingModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.OntModelCache;
+import edu.cornell.mannlib.vitro.webapp.modules.Application;
+import edu.cornell.mannlib.vitro.webapp.modules.ComponentStartupStatus;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ConfigurationTripleSource;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.TripleStoreQuirks;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceFactorySingle;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.tdb.RDFServiceTDB;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.logging.LoggingRDFServiceFactory;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.ConfigurationDataStructuresProvider;
-import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
/**
@@ -35,37 +34,37 @@ import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
* returns that single RDFService, a single instance of the Dataset and the
* ModelMaker.
*
+ * We keep a copy of the RDFService wrapped in an Unclosable shell, and hand
+ * that out when requested. The inner RDFService is only closed on shutdown().
+ *
* Memory-map all of the configuration models, and add the standard decorators.
*/
-public class ConfigurationDataStructuresProviderTDB extends
- ConfigurationDataStructuresProvider {
-
+public class ConfigurationTripleSourceTDB extends ConfigurationTripleSource {
private static final String DIRECTORY_TDB = "tdbModels";
- private final ConfigurationProperties props;
- private final StartupStatus ss;
+ private final TripleStoreQuirks quirks = new TDBTripleStoreQuirks();
- private final RDFServiceFactory rdfServiceFactory;
- private final RDFService rdfService;
- private final Dataset dataset;
- private final ModelMaker modelMaker;
-
- public ConfigurationDataStructuresProviderTDB(ServletContext ctx,
- ServletContextListener ctxListener) {
- this.props = ConfigurationProperties.getBean(ctx);
- this.ss = StartupStatus.getBean(ctx);
+ private volatile RDFService rdfService;
+ private RDFServiceFactory rdfServiceFactory;
+ private RDFService unclosableRdfService;
+ private Dataset dataset;
+ private ModelMaker modelMaker;
+ @Override
+ public void startup(Application application, ComponentStartupStatus ss) {
configureTDB();
- String tdbPath = props.getProperty("vitro.home") + File.separatorChar
- + DIRECTORY_TDB;
+ Path vitroHome = ApplicationUtils.instance().getHomeDirectory()
+ .getPath();
+ String tdbPath = vitroHome.resolve(DIRECTORY_TDB).toString();
try {
- this.rdfServiceFactory = createRDFServiceFactory(tdbPath);
- this.rdfService = this.rdfServiceFactory.getRDFService();
- this.dataset = new RDFServiceDataset(this.rdfService);
+ this.rdfService = new RDFServiceTDB(tdbPath);
+ this.rdfServiceFactory = createRDFServiceFactory();
+ this.unclosableRdfService = this.rdfServiceFactory.getRDFService();
+ this.dataset = new RDFServiceDataset(this.unclosableRdfService);
this.modelMaker = createModelMaker();
- ss.info(ctxListener, "Initialized the RDF source for TDB");
+ ss.info("Initialized the RDF source for TDB");
} catch (IOException e) {
throw new RuntimeException(
"Failed to set up the RDF source for TDB", e);
@@ -76,16 +75,15 @@ public class ConfigurationDataStructuresProviderTDB extends
TDB.getContext().setTrue(TDB.symUnionDefaultGraph);
}
- private RDFServiceFactory createRDFServiceFactory(String tdbPath)
- throws IOException {
+ private RDFServiceFactory createRDFServiceFactory() {
return new LoggingRDFServiceFactory(new RDFServiceFactorySingle(
- new RDFServiceTDB(tdbPath)));
+ this.rdfService));
}
private ModelMaker createModelMaker() {
ModelMaker longTermModelMaker = new ListCachingModelMaker(
new MemoryMappingModelMaker(new RDFServiceModelMaker(
- this.rdfService), CONFIGURATION_MODELS));
+ this.unclosableRdfService), CONFIGURATION_MODELS));
return addConfigurationDecorators(longTermModelMaker);
}
@@ -96,7 +94,7 @@ public class ConfigurationDataStructuresProviderTDB extends
@Override
public RDFService getRDFService() {
- return this.rdfService;
+ return this.unclosableRdfService;
}
@Override
@@ -117,15 +115,23 @@ public class ConfigurationDataStructuresProviderTDB extends
}
@Override
- public void close() {
- if (this.rdfService != null) {
- this.rdfService.close();
- }
+ public TripleStoreQuirks getQuirks() {
+ return quirks;
}
@Override
public String toString() {
- return "ConfigurationDataStructuresProviderTDB["
- + ToString.hashHex(this) + "]";
+ return "ConfigurationTripleSourceTDB[" + ToString.hashHex(this) + "]";
}
+
+ @Override
+ public void shutdown(Application application) {
+ synchronized (this) {
+ if (this.rdfService != null) {
+ this.rdfService.close();
+ this.rdfService = null;
+ }
+ }
+ }
+
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/tdb/ContentDataStructuresProviderTDB.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/tdb/ContentTripleSourceTDB.java
similarity index 54%
rename from webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/tdb/ContentDataStructuresProviderTDB.java
rename to webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/tdb/ContentTripleSourceTDB.java
index bcd95680f..2fde9f53d 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/servlet/setup/rdfsetup/impl/tdb/ContentDataStructuresProviderTDB.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/tdb/ContentTripleSourceTDB.java
@@ -1,29 +1,29 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
-package edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.tdb;
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl.tdb;
import java.io.IOException;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextListener;
-
import com.hp.hpl.jena.query.Dataset;
import com.hp.hpl.jena.rdf.model.ModelMaker;
import com.hp.hpl.jena.tdb.TDB;
-import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
import edu.cornell.mannlib.vitro.webapp.dao.jena.RDFServiceDataset;
import edu.cornell.mannlib.vitro.webapp.dao.jena.RDFServiceModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.adapters.ListCachingModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.adapters.MemoryMappingModelMaker;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ontmodels.OntModelCache;
+import edu.cornell.mannlib.vitro.webapp.modules.Application;
+import edu.cornell.mannlib.vitro.webapp.modules.ComponentStartupStatus;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ContentTripleSource;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.TripleStoreQuirks;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceFactorySingle;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.tdb.RDFServiceTDB;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.logging.LoggingRDFServiceFactory;
-import edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.impl.ContentDataStructuresProvider;
-import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Property;
+import edu.cornell.mannlib.vitro.webapp.utils.configuration.Validation;
import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
/**
@@ -34,36 +34,51 @@ import edu.cornell.mannlib.vitro.webapp.utils.logging.ToString;
* returns that single RDFService, a single instance of the Dataset and the
* ModelMaker.
*
+ * We keep a copy of the RDFService wrapped in an Unclosable shell, and hand
+ * that out when requested. The inner RDFService is only closed on shutdown().
+ *
* Memory-map the small content models, and add the standard decorators.
*/
-public class ContentDataStructuresProviderTDB extends
- ContentDataStructuresProvider {
+public class ContentTripleSourceTDB extends ContentTripleSource {
+ private final TripleStoreQuirks quirks = new TDBTripleStoreQuirks();
- public static final String PROPERTY_CONTENT_TDB_PATH = "VitroConnection.DataSource.tdbDirectory";
+ private String tdbPath;
- private final ConfigurationProperties props;
- private final StartupStatus ss;
+ private volatile RDFService rdfService;
+ private RDFServiceFactory rdfServiceFactory;
+ private RDFService unclosableRdfService;
+ private Dataset dataset;
+ private ModelMaker modelMaker;
- private final RDFServiceFactory rdfServiceFactory;
- private final RDFService rdfService;
- private final Dataset dataset;
- private final ModelMaker modelMaker;
+ @Property(uri = "http://vitro.mannlib.cornell.edu/ns/vitro/ApplicationSetup#hasTdbDirectory")
+ public void setTdbPath(String path) {
+ if (tdbPath == null) {
+ tdbPath = path;
+ } else {
+ throw new IllegalStateException(
+ "Configuration includes multiple instances of TdbDirectory: "
+ + tdbPath + ", and " + path);
+ }
+ }
- public ContentDataStructuresProviderTDB(ServletContext ctx,
- ServletContextListener ctxListener) {
- this.props = ConfigurationProperties.getBean(ctx);
- this.ss = StartupStatus.getBean(ctx);
+ @Validation
+ public void validate() throws Exception {
+ if (tdbPath == null) {
+ throw new IllegalStateException(
+ "Configuration did not include a TdbDirectory.");
+ }
+ }
+ @Override
+ public void startup(Application application, ComponentStartupStatus ss) {
configureTDB();
-
- String tdbPath = props.getProperty(PROPERTY_CONTENT_TDB_PATH);
-
try {
this.rdfService = new RDFServiceTDB(tdbPath);
this.rdfServiceFactory = createRDFServiceFactory();
- this.dataset = new RDFServiceDataset(this.rdfService);
+ this.unclosableRdfService = this.rdfServiceFactory.getRDFService();
+ this.dataset = new RDFServiceDataset(this.unclosableRdfService);
this.modelMaker = createModelMaker();
- ss.info(ctxListener, "Initialized the RDF source for TDB");
+ ss.info("Initialized the RDF source for TDB");
} catch (IOException e) {
throw new RuntimeException(
"Failed to set up the RDF source for TDB", e);
@@ -82,7 +97,7 @@ public class ContentDataStructuresProviderTDB extends
private ModelMaker createModelMaker() {
return addContentDecorators(new ListCachingModelMaker(
new MemoryMappingModelMaker(new RDFServiceModelMaker(
- this.rdfService), SMALL_CONTENT_MODELS)));
+ this.unclosableRdfService), SMALL_CONTENT_MODELS)));
}
@Override
@@ -92,7 +107,7 @@ public class ContentDataStructuresProviderTDB extends
@Override
public RDFService getRDFService() {
- return this.rdfService;
+ return this.unclosableRdfService;
}
@Override
@@ -113,16 +128,22 @@ public class ContentDataStructuresProviderTDB extends
}
@Override
- public void close() {
- if (this.rdfService != null) {
- this.rdfService.close();
- }
+ public TripleStoreQuirks getQuirks() {
+ return quirks;
}
@Override
public String toString() {
- return "ContentDataStructuresProviderTDB[" + ToString.hashHex(this)
- + "]";
+ return "ContentTripleSourceTDB[" + ToString.hashHex(this) + "]";
}
+ @Override
+ public void shutdown(Application application) {
+ synchronized (this) {
+ if (this.rdfService != null) {
+ this.rdfService.close();
+ this.rdfService = null;
+ }
+ }
+ }
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/tdb/TDBTripleStoreQuirks.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/tdb/TDBTripleStoreQuirks.java
new file mode 100644
index 000000000..936c93f03
--- /dev/null
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/triplesource/impl/tdb/TDBTripleStoreQuirks.java
@@ -0,0 +1,58 @@
+/* $This file is distributed under the terms of the license in /doc/license.txt$ */
+
+package edu.cornell.mannlib.vitro.webapp.triplesource.impl.tdb;
+
+import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDinteger;
+import static com.hp.hpl.jena.datatypes.xsd.XSDDatatype.XSDnonNegativeInteger;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+
+import edu.cornell.mannlib.vitro.webapp.triplesource.impl.DefaultTripleStoreQuirks;
+
+/**
+ * TDB has some odd behaviors to deal with.
+ */
+public class TDBTripleStoreQuirks extends DefaultTripleStoreQuirks {
+ private static final Log log = LogFactory
+ .getLog(TDBTripleStoreQuirks.class);
+
+ /**
+ * When the file graph was previously written to the TDB store, TDB mangled
+ * some of the literal types: any type of XMLSchema#nonNegativeInteger was
+ * changed to XMLSchema#integer.
+ *
+ * We need to mangle our new model in the same way before comparing to the
+ * previous one.
+ */
+ @Override
+ public boolean hasFileGraphChanged(Model fromFile, Model previous,
+ String graphURI) {
+ try {
+ ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ fromFile.write(buffer, "N-TRIPLE");
+ String fromString = buffer.toString("UTF-8");
+
+ String mangleString = fromString.replace(
+ XSDnonNegativeInteger.getURI(), XSDinteger.getURI());
+ InputStream mangleStream = new ByteArrayInputStream(
+ mangleString.getBytes("UTF-8"));
+ Model mangled = ModelFactory.createDefaultModel();
+ mangled.read(mangleStream, null, "N-TRIPLE");
+
+ return !mangled.isIsomorphicWith(previous);
+ } catch (Exception e) {
+ log.warn("Failed to test for changes in filegraph. "
+ + "Change assumed.", e);
+ return true;
+ }
+ }
+
+}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/developer/DeveloperSettings.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/developer/DeveloperSettings.java
index e5ce43bf9..36dc530a4 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/developer/DeveloperSettings.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/developer/DeveloperSettings.java
@@ -5,7 +5,7 @@ package edu.cornell.mannlib.vitro.webapp.utils.developer;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
-import java.nio.file.Paths;
+import java.nio.file.Path;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.HashMap;
@@ -20,7 +20,7 @@ import javax.servlet.ServletContextListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties;
+import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
/**
@@ -194,12 +194,10 @@ public class DeveloperSettings {
public void contextInitialized(ServletContextEvent sce) {
ServletContext ctx = sce.getServletContext();
StartupStatus ss = StartupStatus.getBean(ctx);
- ConfigurationProperties props = ConfigurationProperties
- .getBean(ctx);
DeveloperSettings devSettings = DeveloperSettings.getInstance();
- String home = props.getProperty("vitro.home");
- File dsFile = Paths.get(home, "developer.properties").toFile();
+ Path homeDir = ApplicationUtils.instance().getHomeDirectory().getPath();
+ File dsFile = homeDir.resolve("developer.properties").toFile();
try (FileReader reader = new FileReader(dsFile)) {
Properties dsProps = new Properties();
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/developer/loggers/StackTraceUtility.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/developer/loggers/StackTraceUtility.java
index 8797c9c00..747cbf772 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/developer/loggers/StackTraceUtility.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/developer/loggers/StackTraceUtility.java
@@ -124,8 +124,9 @@ public class StackTraceUtility {
StringBuilder sb = new StringBuilder();
if (requested) {
for (StackTraceElement ste : stackTrace) {
- sb.append(String.format(" line %4d, %s \n",
- ste.getLineNumber(), ste.getClassName()));
+ sb.append(String.format(" %s.%s(%s:%d) \n",
+ ste.getClassName(), ste.getMethodName(),
+ ste.getFileName(), ste.getLineNumber()));
}
sb.append(" ...\n");
}
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/DataPropertyTemplateModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/DataPropertyTemplateModel.java
index de644d77c..9cba71164 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/DataPropertyTemplateModel.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/DataPropertyTemplateModel.java
@@ -69,8 +69,7 @@ public class DataPropertyTemplateModel extends PropertyTemplateModel {
DataPropertyTemplateModel(DataProperty dp, Individual subject, VitroRequest vreq,
boolean editing, List populatedDataPropertyList) {
- super(dp, subject, vreq);
- setName(dp.getPublicName());
+ super(dp, subject, vreq, dp.getPublicName());
// Get the config for this data property
try {
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java
index fa2f3c0ec..013f6afcc 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java
@@ -20,10 +20,10 @@ import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
import edu.cornell.mannlib.vitro.webapp.beans.Property;
import edu.cornell.mannlib.vitro.webapp.beans.PropertyGroup;
import edu.cornell.mannlib.vitro.webapp.beans.PropertyInstance;
-import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
+import edu.cornell.mannlib.vitro.webapp.dao.PropertyDao.FullPropertyKey;
import edu.cornell.mannlib.vitro.webapp.dao.PropertyGroupDao;
import edu.cornell.mannlib.vitro.webapp.dao.PropertyInstanceDao;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
@@ -42,7 +42,6 @@ import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel;
*/
public class GroupedPropertyList extends BaseTemplateModel {
- private static final long serialVersionUID = 1L;
private static final Log log = LogFactory.getLog(GroupedPropertyList.class);
private static final int MAX_GROUP_DISPLAY_RANK = 99;
@@ -247,16 +246,9 @@ public class GroupedPropertyList extends BaseTemplateModel {
}
boolean addToList = true;
for(ObjectProperty op : populatedObjectPropertyList) {
- RedundancyReason reason = redundant(op, piOp);
- if(reason != null) {
- addToList = false;
- if (reason == RedundancyReason.LABEL_AND_URI_MATCH
- && moreRestrictiveRange(piOp, op, wadf)) {
- op.setRangeVClassURI(piOp.getRangeVClassURI());
- op.setRangeVClass(piOp.getRangeVClass());
- }
- break;
- }
+ if (redundant(op, piOp)) {
+ addToList = false;
+ }
}
if(addToList) {
propertyList.add(piOp);
@@ -281,67 +273,8 @@ public class GroupedPropertyList extends BaseTemplateModel {
return propertyList;
}
- private enum RedundancyReason {
- LABEL_AND_URI_MATCH, LABEL_URI_DOMAIN_AND_RANGE_MATCH
- }
-
- private boolean moreRestrictiveRange(ObjectProperty piOp, ObjectProperty op,
- WebappDaoFactory wadf) {
- if(piOp.getRangeVClassURI() == null) {
- return false;
- } else if (op.getRangeVClassURI() == null) {
- return (piOp.getRangeVClassURI() != null);
- } else {
- //Check and see if the range vclass exists for the possible piOp and populated op properties,
- //because for populated properties, if the range class is a union,
- //blank nodes will be broken and the code should instead use the existing or piOp range class uri
- VClass piOpRangeClass = wadf.getVClassDao().getVClassByURI(piOp.getRangeVClassURI());
- VClass opRangeClass = wadf.getVClassDao().getVClassByURI(op.getRangeVClassURI());
- //if the possible range class exists but the populated one does not, then return true to allow the possible
- //class to be utilized
- if(piOpRangeClass != null && opRangeClass == null) return true;
- return (wadf.getVClassDao().isSubClassOf(
- piOp.getRangeVClassURI(), op.getRangeVClassURI()));
- }
- }
-
- private RedundancyReason redundant(ObjectProperty op, ObjectProperty op2) {
- if (op2.getURI() == null) {
- return null;
- }
- boolean uriMatches = (op.getURI() != null
- && op.getURI().equals(op2.getURI()));
- boolean domainMatches = false;
- boolean rangeMatches = false;
- boolean labelMatches = false;
- if(op.getDomainPublic() == null) {
- if(op2.getDomainPublic() == null) {
- labelMatches = true;
- }
- } else if (op.getDomainPublic().equals(op2.getDomainPublic())) {
- labelMatches = true;
- }
- if(uriMatches && labelMatches) {
- return RedundancyReason.LABEL_AND_URI_MATCH;
- }
- if(op.getDomainVClassURI() == null) {
- if(op2.getDomainVClassURI() == null) {
- domainMatches = true;
- }
- } else if (op.getDomainVClassURI().equals(op2.getDomainVClassURI())) {
- domainMatches = true;
- }
- if(op.getRangeVClassURI() == null) {
- if (op2.getRangeVClassURI() == null) {
- rangeMatches = true;
- }
- } else if (op.getRangeVClassURI().equals(op2.getRangeVClassURI())) {
- rangeMatches = true;
- }
- if (uriMatches && domainMatches && rangeMatches) {
- return RedundancyReason.LABEL_URI_DOMAIN_AND_RANGE_MATCH;
- }
- return null;
+ private boolean redundant(ObjectProperty op, ObjectProperty op2) {
+ return new FullPropertyKey(op).equals(new FullPropertyKey(op2));
}
private void addObjectPropertyToPropertyList(String propertyUri, String domainUri, String rangeUri,
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyTemplateModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyTemplateModel.java
index 9401dd50e..ceb2358f3 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyTemplateModel.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ObjectPropertyTemplateModel.java
@@ -86,8 +86,7 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
boolean editing)
throws InvalidConfigurationException {
- super(op, subject, vreq);
- setName(op.getDomainPublic());
+ super(op, subject, vreq, op.getDomainPublic());
sortDirection = op.getDomainEntitySortDirection();
domainUri = op.getDomainVClassURI();
@@ -232,7 +231,6 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
public static ObjectPropertyTemplateModel getObjectPropertyTemplateModel(ObjectProperty op,
Individual subject, VitroRequest vreq, boolean editing,
List populatedObjectPropertyList) {
-
if (op.getCollateBySubclass()) {
try {
return new CollatedObjectPropertyTemplateModel(op, subject, vreq, editing, populatedObjectPropertyList);
diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyTemplateModel.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyTemplateModel.java
index e0910761a..d8a0186fd 100644
--- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyTemplateModel.java
+++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/PropertyTemplateModel.java
@@ -13,13 +13,11 @@ import edu.cornell.mannlib.vitro.webapp.auth.policy.PolicyHelper;
import edu.cornell.mannlib.vitro.webapp.beans.BaseResourceBean.RoleLevel;
import edu.cornell.mannlib.vitro.webapp.beans.FauxProperty;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
-import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
import edu.cornell.mannlib.vitro.webapp.beans.Property;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Route;
import edu.cornell.mannlib.vitro.webapp.dao.FauxPropertyDao;
-import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel;
@@ -42,21 +40,23 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
protected String addUrl;
private String name;
-
-
+ private FauxProperty fauxProperty;
- PropertyTemplateModel(Property property, Individual subject, VitroRequest vreq) {
+ PropertyTemplateModel(Property property, Individual subject, VitroRequest vreq, String name) {
this.vreq = vreq;
subjectUri = subject.getURI();
this.property = property;
propertyUri = property.getURI();
localName = property.getLocalName();
- setVerboseDisplayValues(property);
+ this.name = name;
addUrl = "";
- // Do in subclass constructor. The label has not been set on the property, and the
- // means of getting the label differs between object and data properties.
- // this.name = property.getLabel();
+ fauxProperty = isFauxProperty(property);
+ if (fauxProperty != null) {
+ this.name = fauxProperty.getDisplayName();
+ }
+
+ setVerboseDisplayValues(property);
}
protected void setVerboseDisplayValues(Property property) {
@@ -103,7 +103,6 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
String editUrl = UrlBuilder.getUrl(getPropertyEditRoute(), "uri", property.getURI());
verboseDisplay.put("propertyEditUrl", editUrl);
- FauxProperty fauxProperty = isFauxProperty(property);
if (fauxProperty != null) {
verboseDisplay.put("fauxProperty", assembleFauxPropertyValues(fauxProperty));
}
@@ -129,10 +128,6 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
protected abstract int getPropertyDisplayTier(Property p);
protected abstract Route getPropertyEditRoute();
- protected void setName(String name) {
- this.name = name;
- }
-
public String toString() {
return String.format("%s on %s",
propertyUri != null ? propertyUri : "null Prop URI",
diff --git a/webapp/test/edu/cornell/mannlib/vitro/testing/AbstractTestClass.java b/webapp/test/edu/cornell/mannlib/vitro/testing/AbstractTestClass.java
index 9c9a2adb6..168b9144b 100644
--- a/webapp/test/edu/cornell/mannlib/vitro/testing/AbstractTestClass.java
+++ b/webapp/test/edu/cornell/mannlib/vitro/testing/AbstractTestClass.java
@@ -2,9 +2,9 @@
package edu.cornell.mannlib.vitro.testing;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.fail;
import static org.hamcrest.Matchers.containsString;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/auth/policy/SelfEditingPolicyTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/auth/policy/SelfEditingPolicyTest.java
index 547c043b9..95cc96aff 100644
--- a/webapp/test/edu/cornell/mannlib/vitro/webapp/auth/policy/SelfEditingPolicyTest.java
+++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/auth/policy/SelfEditingPolicyTest.java
@@ -5,9 +5,9 @@ package edu.cornell.mannlib.vitro.webapp.auth.policy;
import static edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization.AUTHORIZED;
import static edu.cornell.mannlib.vitro.webapp.auth.policy.ifaces.Authorization.INCONCLUSIVE;
import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction.SOME_LITERAL;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import org.junit.Before;
import org.junit.Test;
diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/config/RevisionInfoBeanTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/config/RevisionInfoBeanTest.java
index 0c44bafd0..d5fb0ae04 100644
--- a/webapp/test/edu/cornell/mannlib/vitro/webapp/config/RevisionInfoBeanTest.java
+++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/config/RevisionInfoBeanTest.java
@@ -4,7 +4,7 @@ package edu.cornell.mannlib.vitro.webapp.config;
import static edu.cornell.mannlib.vitro.webapp.config.RevisionInfoBean.DUMMY_BEAN;
import static edu.cornell.mannlib.vitro.webapp.config.RevisionInfoBean.LevelRevisionInfo.DUMMY_LEVEL;
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.Date;
diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualRequestAnalyzerTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualRequestAnalyzerTest.java
index 7e1a0cb9a..273347fd4 100644
--- a/webapp/test/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualRequestAnalyzerTest.java
+++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/controller/individual/IndividualRequestAnalyzerTest.java
@@ -5,8 +5,8 @@ package edu.cornell.mannlib.vitro.webapp.controller.individual;
import static edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet.N3_MIMETYPE;
import static edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet.RDFXML_MIMETYPE;
import static edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet.TTL_MIMETYPE;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import java.net.URL;
diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/dao/filtering/IndividualFilteringByStatementTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/dao/filtering/IndividualFilteringByStatementTest.java
index 2dcc40f39..7363e8b21 100644
--- a/webapp/test/edu/cornell/mannlib/vitro/webapp/dao/filtering/IndividualFilteringByStatementTest.java
+++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/dao/filtering/IndividualFilteringByStatementTest.java
@@ -3,7 +3,7 @@
package edu.cornell.mannlib.vitro.webapp.dao.filtering;
import static edu.cornell.mannlib.vitro.webapp.auth.requestedAction.RequestedAction.SOME_URI;
-import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.util.ArrayList;
diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NameFieldsTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NameFieldsTest.java
index d4e2767cf..1a7c163e1 100644
--- a/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NameFieldsTest.java
+++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NameFieldsTest.java
@@ -2,6 +2,7 @@
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
+import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONTENT;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.NAME_RAW;
import static org.junit.Assert.assertEquals;
@@ -9,6 +10,7 @@ import org.junit.Before;
import org.junit.Test;
import stubs.edu.cornell.mannlib.vitro.webapp.beans.IndividualStub;
+import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccessStub;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
@@ -16,8 +18,6 @@ import com.hp.hpl.jena.rdf.model.Statement;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceFactorySingle;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
import edu.cornell.mannlib.vitro.webapp.searchengine.base.BaseSearchInputDocument;
@@ -38,27 +38,29 @@ public class NameFieldsTest {
doc = new BaseSearchInputDocument();
RDFServiceModel rdfService = new RDFServiceModel(baseModel);
- RDFServiceFactory rdfServiceFactory = new RDFServiceFactorySingle(
- rdfService);
- nameFields = new NameFields(rdfServiceFactory);
+ ContextModelAccessStub models = new ContextModelAccessStub();
+ models.setRDFService(CONTENT, rdfService);
+
+ nameFields = new NameFields();
+ nameFields.setContextModels(models);
}
@Test
- public void nullIndividual() throws SkipIndividualException {
+ public void nullIndividual() {
SearchInputDocument expected = new BaseSearchInputDocument(doc);
assertResultingSearchDocument(null, expected);
}
@Test
- public void nullUri() throws SkipIndividualException {
+ public void nullUri() {
SearchInputDocument expected = new BaseSearchInputDocument(doc);
assertResultingSearchDocument(new IndividualStub(null), expected);
}
@Test
- public void foundNoLabels() throws SkipIndividualException {
+ public void foundNoLabels() {
SearchInputDocument expected = new BaseSearchInputDocument(doc);
expected.addField(NAME_RAW, "");
@@ -67,7 +69,7 @@ public class NameFieldsTest {
}
@Test
- public void foundOneLabel() throws SkipIndividualException {
+ public void foundOneLabel() {
baseModel.add(stmt(INDIVIDUAL_URI, LABEL_PROPERTY_URI, "label1"));
SearchInputDocument expected = new BaseSearchInputDocument(doc);
@@ -78,7 +80,7 @@ public class NameFieldsTest {
}
@Test
- public void foundTwoLabels() throws SkipIndividualException {
+ public void foundTwoLabels() {
baseModel.add(stmt(INDIVIDUAL_URI, LABEL_PROPERTY_URI, "label1"));
baseModel.add(stmt(INDIVIDUAL_URI, LABEL_PROPERTY_URI, "label2"));
@@ -100,7 +102,7 @@ public class NameFieldsTest {
}
private void assertResultingSearchDocument(Individual ind,
- SearchInputDocument expected) throws SkipIndividualException {
+ SearchInputDocument expected) {
nameFields.modifyDocument(ind, doc);
assertEquals(expected, doc);
}
diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURLTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURLTest.java
index 285152e8d..b5c9149cf 100644
--- a/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURLTest.java
+++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURLTest.java
@@ -4,6 +4,8 @@
*/
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
+import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONTENT;
+
import java.io.InputStream;
import org.apache.log4j.Level;
@@ -11,6 +13,7 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import stubs.edu.cornell.mannlib.vitro.webapp.modelaccess.ContextModelAccessStub;
import stubs.edu.cornell.mannlib.vitro.webapp.modules.ApplicationStub;
import stubs.edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngineStub;
import stubs.javax.servlet.ServletContextStub;
@@ -25,13 +28,11 @@ import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.IndividualImpl;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputField;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory;
-import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceFactorySingle;
import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.jena.model.RDFServiceModel;
import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames;
public class ThumbnailImageURLTest extends AbstractTestClass{
- RDFServiceFactory testRDF;
+ ContextModelAccessStub contextModels;
String personsURI = "http://vivo.cornell.edu/individual/individual8803";
/**
@@ -45,7 +46,8 @@ public class ThumbnailImageURLTest extends AbstractTestClass{
Model model = ModelFactory.createDefaultModel();
InputStream in = ThumbnailImageURLTest.class.getResourceAsStream("testPerson.n3");
model.read(in,"","N3");
- testRDF = new RDFServiceFactorySingle( new RDFServiceModel( model ) );
+ contextModels = new ContextModelAccessStub();
+ contextModels.setRDFService(CONTENT, new RDFServiceModel( model ));
}
/**
@@ -55,7 +57,8 @@ public class ThumbnailImageURLTest extends AbstractTestClass{
@Test
public void testThumbnailFieldCreatedInSearchDoc() {
SearchInputDocument doc = ApplicationUtils.instance().getSearchEngine().createInputDocument();
- ThumbnailImageURL testMe = new ThumbnailImageURL( testRDF );
+ ThumbnailImageURL testMe = new ThumbnailImageURL();
+ testMe.setContextModels(contextModels);
Individual ind = new IndividualImpl();
ind.setURI(personsURI);
diff --git a/webapp/test/freemarker/ext/dump/DumpAllDirectiveTest.java b/webapp/test/freemarker/ext/dump/DumpAllDirectiveTest.java
index 336c5c1f7..9fa77c103 100644
--- a/webapp/test/freemarker/ext/dump/DumpAllDirectiveTest.java
+++ b/webapp/test/freemarker/ext/dump/DumpAllDirectiveTest.java
@@ -2,8 +2,8 @@
package freemarker.ext.dump;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.fail;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
import java.io.StringReader;
import java.io.StringWriter;
diff --git a/webapp/test/freemarker/ext/dump/DumpDirectiveTest.java b/webapp/test/freemarker/ext/dump/DumpDirectiveTest.java
index 1178ac9c3..54916c659 100644
--- a/webapp/test/freemarker/ext/dump/DumpDirectiveTest.java
+++ b/webapp/test/freemarker/ext/dump/DumpDirectiveTest.java
@@ -2,8 +2,8 @@
package freemarker.ext.dump;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.fail;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
import java.io.IOException;
import java.io.StringReader;
diff --git a/webapp/test/stubs/edu/cornell/mannlib/vitro/webapp/modelaccess/ContextModelAccessStub.java b/webapp/test/stubs/edu/cornell/mannlib/vitro/webapp/modelaccess/ContextModelAccessStub.java
index 1ab169f23..566b6cb02 100644
--- a/webapp/test/stubs/edu/cornell/mannlib/vitro/webapp/modelaccess/ContextModelAccessStub.java
+++ b/webapp/test/stubs/edu/cornell/mannlib/vitro/webapp/modelaccess/ContextModelAccessStub.java
@@ -3,7 +3,9 @@
package stubs.edu.cornell.mannlib.vitro.webapp.modelaccess;
import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.ReasoningOption.ASSERTIONS_AND_INFERENCES;
+import static edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess.WhichService.CONTENT;
+import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
@@ -30,6 +32,7 @@ public class ContextModelAccessStub implements ContextModelAccess {
// ----------------------------------------------------------------------
private final Map wadfMap = new HashMap<>();
+ private final Map rdfServiceMap = new EnumMap<>(WhichService.class);
public void setWebappDaoFactory(WebappDaoFactory wadf) {
setWebappDaoFactory(wadf, ASSERTIONS_AND_INFERENCES);
@@ -39,6 +42,10 @@ public class ContextModelAccessStub implements ContextModelAccess {
ReasoningOption option) {
wadfMap.put(option, wadf);
}
+
+ public void setRDFService(WhichService which, RDFService rdfService) {
+ rdfServiceMap.put(which, rdfService);
+ }
// ----------------------------------------------------------------------
// Stub methods
@@ -49,22 +56,20 @@ public class ContextModelAccessStub implements ContextModelAccess {
return wadfMap.get(ASSERTIONS_AND_INFERENCES);
}
+ @Override
+ public RDFService getRDFService() {
+ return getRDFService(CONTENT);
+ }
+
+ @Override
+ public RDFService getRDFService(WhichService which) {
+ return rdfServiceMap.get(which);
+ }
+
// ----------------------------------------------------------------------
// Un-implemented methods
// ----------------------------------------------------------------------
- @Override
- public RDFService getRDFService() {
- throw new RuntimeException(
- "ContextModelAccessStub.getRDFService() not implemented.");
- }
-
- @Override
- public RDFService getRDFService(WhichService which) {
- throw new RuntimeException(
- "ContextModelAccessStub.getRDFService() not implemented.");
- }
-
@Override
public Dataset getDataset() {
throw new RuntimeException(
diff --git a/webapp/test/stubs/edu/cornell/mannlib/vitro/webapp/modules/ApplicationStub.java b/webapp/test/stubs/edu/cornell/mannlib/vitro/webapp/modules/ApplicationStub.java
index 7ec549add..f5aeaf92f 100644
--- a/webapp/test/stubs/edu/cornell/mannlib/vitro/webapp/modules/ApplicationStub.java
+++ b/webapp/test/stubs/edu/cornell/mannlib/vitro/webapp/modules/ApplicationStub.java
@@ -7,10 +7,13 @@ import java.lang.reflect.Field;
import javax.servlet.ServletContext;
import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils;
+import edu.cornell.mannlib.vitro.webapp.application.VitroHomeDirectory;
import edu.cornell.mannlib.vitro.webapp.modules.Application;
import edu.cornell.mannlib.vitro.webapp.modules.fileStorage.FileStorage;
import edu.cornell.mannlib.vitro.webapp.modules.imageProcessor.ImageProcessor;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngine;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ConfigurationTripleSource;
+import edu.cornell.mannlib.vitro.webapp.modules.tripleSource.ContentTripleSource;
/**
* TODO
@@ -61,6 +64,12 @@ public class ApplicationStub implements Application {
// Un-implemented methods
// ----------------------------------------------------------------------
+ @Override
+ public VitroHomeDirectory getHomeDirectory() {
+ throw new RuntimeException(
+ "ApplicationStub.getHomeDirectory() not implemented.");
+ }
+
@Override
public ImageProcessor getImageProcessor() {
throw new RuntimeException(
@@ -74,4 +83,22 @@ public class ApplicationStub implements Application {
"ApplicationStub.getFileStorage() not implemented.");
}
+ @Override
+ public void shutdown() {
+ throw new RuntimeException(
+ "ApplicationStub.shutdown() not implemented.");
+ }
+
+ @Override
+ public ContentTripleSource getContentTripleSource() {
+ throw new RuntimeException(
+ "ApplicationStub.getContentTripleSource() not implemented.");
+ }
+
+ @Override
+ public ConfigurationTripleSource getConfigurationTripleSource() {
+ throw new RuntimeException(
+ "ApplicationStub.getConfigurationTripleSource() not implemented.");
+ }
+
}
diff --git a/webapp/themes/vitro/templates/menu.ftl b/webapp/themes/vitro/templates/menu.ftl
index badb45f0a..502cc1625 100644
--- a/webapp/themes/vitro/templates/menu.ftl
+++ b/webapp/themes/vitro/templates/menu.ftl
@@ -7,7 +7,7 @@
diff --git a/webapp/web/WEB-INF/resources/startup_listeners.txt b/webapp/web/WEB-INF/resources/startup_listeners.txt
index 94783f0ad..c5c9803eb 100644
--- a/webapp/web/WEB-INF/resources/startup_listeners.txt
+++ b/webapp/web/WEB-INF/resources/startup_listeners.txt
@@ -7,6 +7,8 @@
edu.cornell.mannlib.vitro.webapp.servlet.setup.JvmSmokeTests
+edu.cornell.mannlib.vitro.webapp.application.ApplicationSetup
+
edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSetup
edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSmokeTests
@@ -16,15 +18,12 @@ edu.cornell.mannlib.vitro.webapp.servlet.setup.GuardAgainstUnmigratedRDB
edu.cornell.mannlib.vitro.webapp.utils.developer.DeveloperSettings$Setup
-edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl$Setup
+edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl$ComponentsSetup
edu.cornell.mannlib.vitro.webapp.config.RevisionInfoSetup
edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory$Setup
-# In 1.8, this should replace JenaPersistentDataSourceSetup, RDFServiceSetup, and maybe more.
-edu.cornell.mannlib.vitro.webapp.servlet.setup.rdfsetup.RDFSetup
-
edu.cornell.mannlib.vitro.webapp.servlet.setup.ConfigurationModelsSetup
edu.cornell.mannlib.vitro.webapp.servlet.setup.ContentModelSetup
diff --git a/webapp/web/i18n/all.properties b/webapp/web/i18n/all.properties
index 1a532f434..3f7c0ef3c 100644
--- a/webapp/web/i18n/all.properties
+++ b/webapp/web/i18n/all.properties
@@ -872,6 +872,7 @@ local_name = Local Name
group_capitalized = Group
domain_class = Domain Class
range_class = Range Class
+range_data_type = Range Data Type
sub_properties = Subproperties
subproperty = subproperty
diff --git a/webapp/web/js/siteAdmin/objectPropertyHierarchyUtils.js b/webapp/web/js/siteAdmin/objectPropertyHierarchyUtils.js
index e9ab0a1d5..f1da38900 100644
--- a/webapp/web/js/siteAdmin/objectPropertyHierarchyUtils.js
+++ b/webapp/web/js/siteAdmin/objectPropertyHierarchyUtils.js
@@ -46,6 +46,13 @@
// this.toggleSpan = $('span#propsToggle');
// this.toggleLink = $('span#propsToggle').find('a');
noProps = new Boolean;
+ this.range = ""
+ if ( propertyType == "object" ) {
+ this.range = i18nStrings.rangeClass;
+ }
+ else {
+ this.range = i18nStrings.rangeDataType;
+ }
},
bindEventListeners: function() {
@@ -148,7 +155,7 @@
objectPropHierarchyUtils.classHtml += "" + i18nStrings.domainClass + ": "
+ (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " ";
- objectPropHierarchyUtils.classHtml += "" + i18nStrings.rangeClass + ": "
+ objectPropHierarchyUtils.classHtml += "" + objectPropHierarchyUtils.range + ": "
+ (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + " ";
if ( descendants.length > 1 ) {
@@ -209,7 +216,7 @@
childDetails += "" + i18nStrings.domainClass + ": "
+ (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " ";
- childDetails += "" + i18nStrings.rangeClass + ": "
+ childDetails += "" + objectPropHierarchyUtils.range + ": "
+ (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + " ";
if ( this.children ) {
@@ -300,7 +307,7 @@
objectPropHierarchyUtils.classHtml += "" + i18nStrings.domainClass + ": "
+ (this.data.domainVClass.length > 0 ? this.data.domainVClass : "none" ) + " ";
- objectPropHierarchyUtils.classHtml += "" + i18nStrings.rangeClass + ": "
+ objectPropHierarchyUtils.classHtml += "" + objectPropHierarchyUtils.range + ": "
+ (this.data.rangeVClass.length > 0 ? this.data.rangeVClass : "none" ) + " ";
objectPropHierarchyUtils.classHtml += "";
diff --git a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-objectPropHierarchy.ftl b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-objectPropHierarchy.ftl
index f969ad013..b0f60fa25 100644
--- a/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-objectPropHierarchy.ftl
+++ b/webapp/web/templates/freemarker/body/siteAdmin/siteAdmin-objectPropHierarchy.ftl
@@ -45,6 +45,7 @@