You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by bb...@apache.org on 2011/07/09 15:58:11 UTC
svn commit: r1144670 - in /incubator/clerezza/trunk/parent/rdf.scala.utils:
./ src/main/scala/org/apache/clerezza/rdf/scala/utils/
src/test/scala/org/apache/clerezza/rdf/scala/utils/
Author: bblfish
Date: Sat Jul 9 13:58:10 2011
New Revision: 1144670
URL: http://svn.apache.org/viewvc?rev=1144670&view=rev
Log:
CLEREZZA-600: Add package object
Added:
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/package.scala
Modified:
incubator/clerezza/trunk/parent/rdf.scala.utils/pom.xml
incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzMGraphTest.scala
Modified: incubator/clerezza/trunk/parent/rdf.scala.utils/pom.xml
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/pom.xml?rev=1144670&r1=1144669&r2=1144670&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/rdf.scala.utils/pom.xml (original)
+++ incubator/clerezza/trunk/parent/rdf.scala.utils/pom.xml Sat Jul 9 13:58:10 2011
@@ -12,7 +12,7 @@
<name>Clerezza - SCB Scala Utilities</name>
<description>OSGi bundle providing utilities for accessing SCB
TripleCollections with Scala. Adding import
- "org.apache.clerezza.rdf.scala.utils.Preamble._" will allow to use
+ "org.apache.clerezza.rdf.scala.utils._" will allow to use
"node/-FOAF.knows/FOAF.name!" with a GraphNode node as shortcut for
node.getSubject(FOAF.knows).getObject(FOAF.name).getNode(). To access
multiple property values the position can be indicated using the %-operator,
Modified: incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala?rev=1144670&r1=1144669&r2=1144670&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala (original)
+++ incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala Sat Jul 9 13:58:10 2011
@@ -68,7 +68,7 @@ protected trait TcDependentConversions {
}
}
-protected trait TcIndependentConversions extends EzLiteralImplicits {
+protected[utils] trait TcIndependentConversions extends EzLiteralImplicits {
implicit def toRichGraphNode(node: GraphNode) = {
new RichGraphNode(node)
}
Added: incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/package.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/package.scala?rev=1144670&view=auto
==============================================================================
--- incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/package.scala (added)
+++ incubator/clerezza/trunk/parent/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/package.scala Sat Jul 9 13:58:10 2011
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.clerezza.rdf.scala
+
+/**
+ * The package object means that all methods defined here-in can be imported with a simple
+ * <code>
+ * import org.apache.clerezza.rdf.scala._
+ * </code>
+ * so there is no need to import both the classes and the Preamble.
+ * @author bblfish
+ */
+package object utils extends TcIndependentConversions
Modified: incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzMGraphTest.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzMGraphTest.scala?rev=1144670&r1=1144669&r2=1144670&view=diff
==============================================================================
--- incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzMGraphTest.scala (original)
+++ incubator/clerezza/trunk/parent/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzMGraphTest.scala Sat Jul 9 13:58:10 2011
@@ -21,7 +21,6 @@ package org.apache.clerezza.rdf.scala.ut
import org.junit._
import org.apache.clerezza.rdf.core._
import impl._
-import Preamble._
import org.apache.clerezza.rdf.ontologies._
class EzMGraphTest {
@@ -138,13 +137,13 @@ class EzMGraphTest {
//We can add triples by creating a new anonymous instance
new EzMGraph(ez) {(
"http://bblfish.net/#hjs".uri -- FOAF.name --> "William"
- -- FOAF.name --> "Bill"
+ -- FOAF.name --> "Bill"
)}
Assert.assertEquals("the triple colletion has grown by one",tinyGraph.size()+2,ez.size)
//or by just importing it
import ez._
ez.b_("danny") -- FOAF.name --> "George"
- Assert.assertEquals("the triple colletion has grown by one",tinyGraph.size()+3,ez.size)
+ Assert.assertEquals("the triple collection has grown by one",tinyGraph.size()+3,ez.size)
}
}