Author: reto
Date: Fri Feb 25 15:47:22 2011
New Revision: 1074588
URL: http://svn.apache.org/viewvc?rev=1074588&view=rev
Log:
CLEREZZA-388: compact string serialization of virtual properties
Modified:
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/ (props changed)
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/ (props changed)
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/pom.xml
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/VirtualProperty.scala
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/ontologies/ (props
changed)
Propchange: incubator/clerezza/issues/CLEREZZA-388/rdf.cris/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Feb 25 15:47:22 2011
@@ -0,0 +1,3 @@
+rdf.cris.iws
+rdf.cris.ipr
+rdf.cris.iml
Propchange: incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Feb 25 15:47:22 2011
@@ -1 +1,2 @@
+rdf.cris.core.iml
target
Modified: incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/pom.xml?rev=1074588&r1=1074587&r2=1074588&view=diff
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/pom.xml (original)
+++ incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/pom.xml Fri Feb 25
15:47:22 2011
@@ -59,7 +59,6 @@
<dependency>
<groupId>org.wymiwyg</groupId>
<artifactId>wymiwyg-commons-core</artifactId>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
Modified:
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/VirtualProperty.scala
URL:
http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/VirtualProperty.scala?rev=1074588&r1=1074587&r2=1074588&view=diff
==============================================================================
---
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/VirtualProperty.scala
(original)
+++
incubator/clerezza/issues/CLEREZZA-388/rdf.cris/core/src/main/scala/org/apache/clerezza/rdf/cris/VirtualProperty.scala
Fri Feb 25 15:47:22 2011
@@ -21,6 +21,7 @@ package org.apache.clerezza.rdf.cris
import org.apache.clerezza.rdf.core.UriRef
import org.apache.clerezza.rdf.scala.utils.RichGraphNode
+import org.wymiwyg.commons.util.Util
import org.apache.clerezza.rdf.scala.utils.Preamble._
abstract class VirtualProperty {
@@ -38,11 +39,20 @@ class PropertyHolder(property: UriRef) e
}
class JoinVirtualProperty(properties: List[VirtualProperty]) extends
VirtualProperty {
- val stringKey = "Join of ..."
+ val stringKey = "J"+VirtualProperty.listDigest(properties)
def value(node: RichGraphNode): Seq[String] = Seq("")
}
class PathVirtualProperty(properties: List[VirtualProperty]) extends
VirtualProperty {
- val stringKey = "Path ..."
+ val stringKey = "P"+VirtualProperty.listDigest(properties)
def value(node: RichGraphNode): Seq[String] = Seq("")
+}
+
+object VirtualProperty {
+ def listDigest(properties: List[VirtualProperty]) = {
+ val longString = (for (p <- properties) yield {
+ p.stringKey
+ }).mkString("|")
+ Util.sha1(longString)
+ }
}
\ No newline at end of file
Propchange: incubator/clerezza/issues/CLEREZZA-388/rdf.cris/ontologies/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Feb 25 15:47:22 2011
@@ -1 +1,2 @@
+rdf.cris.ontologies.iml
target