Author: reto
Date: Fri Mar 18 21:42:07 2011
New Revision: 1083078
URL: http://svn.apache.org/viewvc?rev=1083078&view=rev
Log:
CLEREZZA-388: fixed indentation
Modified:
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/GraphIndexer.scala
Modified:
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/GraphIndexer.scala
URL:
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/GraphIndexer.scala?rev=1083078&r1=1083077&r2=1083078&view=diff
==============================================================================
---
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/GraphIndexer.scala
(original)
+++
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/GraphIndexer.scala
Fri Mar 18 21:42:07 2011
@@ -72,10 +72,11 @@ class GraphIndexer(definitionGraph: Trip
private[this] var type2IndexedProperties: Map[UriRef,
Seq[VirtualProperty]] = null
private[this] var property2TypeMap = Map[VirtualProperty,
mutable.Set[UriRef]]()
- private[this] var property2IncludingVProperty = new mutable.HashMap[UriRef,
mutable.Set[VirtualProperty]]()
- with mutable.MultiMap[UriRef, VirtualProperty] {
- override def default(u: UriRef) = mutable.Set[VirtualProperty]()
- }
+ private[this] var property2IncludingVProperty =
+ new mutable.HashMap[UriRef, mutable.Set[VirtualProperty]]()
+ with mutable.MultiMap[UriRef, VirtualProperty] {
+ override def default(u: UriRef) =
mutable.Set[VirtualProperty]()
+ }
//private[this] var indexedProperties: Seq[UriRef] = null
protected def processDefinitions() {
@@ -156,28 +157,29 @@ class GraphIndexer(definitionGraph: Trip
import scala.collection.JavaConversions._
for (e <- events) {
val triple = e.getTriple
- def followInversePaths(resource: Resource,
pathToIndexedResource: List[UriRef]): Seq[Resource] = {
- if (pathToIndexedResource.size == 0) {
- Seq(resource)
- } else {
- val predecessors = resource/-pathToIndexedResource.head
- val tail = pathToIndexedResource.tail
- (for (predecessor <- predecessors) yield {
- followInversePaths(predecessor!, tail)
- }).flatten
- //throw new RuntimeException("modification of indirect properties
not yet supported")
- }
- }
- val predicate = triple.getPredicate
- val vProperties = property2IncludingVProperty(predicate)
- val indexedResources/*: Seq[Resource]*/ = (for (vProperty <-
vProperties)
- yield followInversePaths(triple.getSubject,
vProperty.pathToIndexedResource(predicate))).flatten
+ def followInversePaths(resource: Resource,
+ pathToIndexedResource:
List[UriRef]): Seq[Resource] = {
+ if (pathToIndexedResource.size == 0) {
+ Seq(resource)
+ } else {
+ val predecessors =
resource/-pathToIndexedResource.head
+ val tail = pathToIndexedResource.tail
+ (for (predecessor <- predecessors)
yield {
+ followInversePaths(predecessor!, tail)
+ }).flatten
+ //throw new
RuntimeException("modification of indirect properties not yet supported")
+ }
+ }
+ val predicate = triple.getPredicate
+ val vProperties =
property2IncludingVProperty(predicate)
+ val indexedResources/*: Seq[Resource]*/ = (for
(vProperty <- vProperties)
+ yield
followInversePaths(triple.getSubject,
vProperty.pathToIndexedResource(predicate))).flatten
for (resource <- indexedResources) {
- val types = for (tn <- resource/RDF.`type`) yield tn!;
- if (types.exists(t => type2IndexedProperties.containsKey(t))) {
- scheduleForReindex(resource)
- }
- }
+ val types = for (tn <- resource/RDF.`type`)
yield tn!;
+ if (types.exists(t =>
type2IndexedProperties.containsKey(t))) {
+ scheduleForReindex(resource)
+ }
+ }
}
}
}, new FilterTriple(null, null, null) {
@@ -228,8 +230,8 @@ class GraphIndexer(definitionGraph: Trip
def resourceToDocument(resource: UriRef, resourceType: UriRef)
= {
val doc = new Document
- val indexedProperties = type2IndexedProperties(resourceType)
- logger.debug("indexing "+resource+" considering
"+indexedProperties.size+" properties ("+indexedProperties+")")
+ val indexedProperties =
type2IndexedProperties(resourceType)
+ logger.debug("indexing "+resource+" considering
"+indexedProperties.size+" properties ("+indexedProperties+")")
for (vProperty <- indexedProperties) {
logger.debug("indexing "+vProperty+" with
values "+(vProperty.value(resource)).length)
for (propertyValue <-
vProperty.value(resource)) {