You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by re...@apache.org on 2015/03/23 17:43:05 UTC
[5/5] clerezza git commit: CLEREZZA-966: moved rdf.scala.utils into
the hierarchy
CLEREZZA-966: moved rdf.scala.utils into the hierarchy
Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/4d35191b
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/4d35191b
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/4d35191b
Branch: refs/heads/rdf-commons
Commit: 4d35191bb30fe315a532320a51479cc9d87f79e7
Parents: cff1c95
Author: Reto Gmuer <re...@apache.org>
Authored: Mon Mar 23 16:42:41 2015 +0000
Committer: Reto Gmuer <re...@apache.org>
Committed: Mon Mar 23 16:42:41 2015 +0000
----------------------------------------------------------------------
platform/pom.xml | 2 +-
pom.xml | 1 -
provisioning/felixosgi/pom.xml | 32 +--
.../launchers/typerendering-launcher/pom.xml | 4 +-
provisioning/rdf.tdb/pom.xml | 4 +-
rdf.scala.utils/LICENSE | 201 ---------------
rdf.scala.utils/pom.xml | 131 ----------
.../rdf/scala/utils/CollectedIter.scala | 133 ----------
.../clerezza/rdf/scala/utils/EzLiteral.scala | 81 ------
.../clerezza/rdf/scala/utils/EzMGraph.scala | 88 -------
.../clerezza/rdf/scala/utils/NameSpace.scala | 37 ---
.../clerezza/rdf/scala/utils/Preamble.scala | 123 ----------
.../rdf/scala/utils/RichGraphNode.scala | 244 -------------------
.../clerezza/rdf/scala/utils/EzMGraphTest.scala | 161 ------------
.../rdf/scala/utils/RichGraphNodeTest.scala | 174 -------------
.../rdf/scala/utils/TypeConversionTest.scala | 74 ------
rdf/pom.xml | 1 +
rdf/scala.utils/LICENSE | 201 +++++++++++++++
rdf/scala.utils/pom.xml | 131 ++++++++++
.../rdf/scala/utils/CollectedIter.scala | 133 ++++++++++
.../clerezza/rdf/scala/utils/EzLiteral.scala | 81 ++++++
.../clerezza/rdf/scala/utils/EzMGraph.scala | 88 +++++++
.../clerezza/rdf/scala/utils/NameSpace.scala | 37 +++
.../clerezza/rdf/scala/utils/Preamble.scala | 123 ++++++++++
.../rdf/scala/utils/RichGraphNode.scala | 244 +++++++++++++++++++
.../clerezza/rdf/scala/utils/EzMGraphTest.scala | 161 ++++++++++++
.../rdf/scala/utils/RichGraphNodeTest.scala | 174 +++++++++++++
.../rdf/scala/utils/TypeConversionTest.scala | 74 ++++++
28 files changed, 1464 insertions(+), 1474 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/platform/pom.xml
----------------------------------------------------------------------
diff --git a/platform/pom.xml b/platform/pom.xml
index 30e4dc3..374f535 100644
--- a/platform/pom.xml
+++ b/platform/pom.xml
@@ -32,7 +32,7 @@
<parent>
<groupId>org.apache.clerezza</groupId>
<artifactId>clerezza</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>7-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 1ae7238..c67c0f0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -75,7 +75,6 @@
<module>rdf.file.storage</module>
<module>rdf.locking</module>
<module>rdf.rdfjson</module>
- <module>rdf.scala.utils</module>
<module>rdf.stable.serializer</module>
<module>rdf.web</module>
<module>shell</module>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/provisioning/felixosgi/pom.xml
----------------------------------------------------------------------
diff --git a/provisioning/felixosgi/pom.xml b/provisioning/felixosgi/pom.xml
index be6d293..49cf57f 100644
--- a/provisioning/felixosgi/pom.xml
+++ b/provisioning/felixosgi/pom.xml
@@ -91,29 +91,19 @@
<!-- Logging Dependencies -->
<dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.commons.log</artifactId>
- <version>3.0.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.commons.logservice</artifactId>
- <version>1.0.2</version>
- </dependency>
- <dependency> <!-- Can not use 1.7 because of o.a.sling.commons.log -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.6.6</version>
+ <groupId>org.ops4j.pax.logging</groupId>
+ <artifactId>pax-logging-api</artifactId>
+ <version>1.8.2</version>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <version>1.6.6</version>
+ <dependency>
+ <groupId>org.ops4j.pax.logging</groupId>
+ <artifactId>pax-logging-service</artifactId>
+ <version>1.8.2</version>
</dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
- <version>1.6.6</version>
+ <dependency>
+ <groupId>org.ops4j.pax.logging</groupId>
+ <artifactId>pax-logging-log4j2</artifactId>
+ <version>1.8.2</version>
</dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/provisioning/launchers/typerendering-launcher/pom.xml
----------------------------------------------------------------------
diff --git a/provisioning/launchers/typerendering-launcher/pom.xml b/provisioning/launchers/typerendering-launcher/pom.xml
index 6e3b2a3..88c7dd7 100644
--- a/provisioning/launchers/typerendering-launcher/pom.xml
+++ b/provisioning/launchers/typerendering-launcher/pom.xml
@@ -214,7 +214,7 @@
<dependency>
<groupId>org.apache.clerezza.provisioning</groupId>
<artifactId>felixosgi</artifactId>
- <version>0.1</version>
+ <version>1.0.0-SNAPSHOT</version>
<type>partialbundlelist</type>
</dependency>
<dependency>
@@ -233,7 +233,7 @@
<dependency>
<groupId>org.apache.clerezza.provisioning</groupId>
<artifactId>rdf.tdb</artifactId>
- <version>0.1</version>
+ <version>1.0.0-SNAPSHOT</version>
<type>partialbundlelist</type>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/provisioning/rdf.tdb/pom.xml
----------------------------------------------------------------------
diff --git a/provisioning/rdf.tdb/pom.xml b/provisioning/rdf.tdb/pom.xml
index 4565f11..aa2ea8d 100644
--- a/provisioning/rdf.tdb/pom.xml
+++ b/provisioning/rdf.tdb/pom.xml
@@ -25,7 +25,7 @@
<parent>
<artifactId>clerezza</artifactId>
<groupId>org.apache.clerezza</groupId>
- <version>0.5</version>
+ <version>7-SNAPSHOT</version>
<relativePath>../../parent</relativePath>
</parent>
@@ -46,7 +46,7 @@
<dependency>
<groupId>org.apache.clerezza</groupId>
<artifactId>rdf.jena.tdb.storage</artifactId>
- <version>0.7</version>
+ <version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/LICENSE
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/LICENSE b/rdf.scala.utils/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/rdf.scala.utils/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed 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.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/pom.xml
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/pom.xml b/rdf.scala.utils/pom.xml
deleted file mode 100644
index 7d8f99e..0000000
--- a/rdf.scala.utils/pom.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-<!--
-
- 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.
-
--->
-
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>clerezza</artifactId>
- <groupId>org.apache.clerezza</groupId>
- <version>7-SNAPSHOT</version>
- <relativePath>../parent</relativePath>
- </parent>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>rdf.scala.utils</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>bundle</packaging>
- <name>Clerezza - RDF Scala Utilities</name>
- <description>OSGi bundle providing utilities for accessing Clerezza RDF Commons
- Graphs with Scala. Adding import
- "org.apache.clerezza.rdf.scala.utils.Preamble._" 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,
- e.g. "node/-FOAF.knows%2/FOAF.name%0!", see the ScalaDocs for RichGraphNode
- for all operations
- </description>
- <dependencies>
- <dependency>
- <groupId>org.scala-lang</groupId>
- <artifactId>scala-library</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>rdf.core</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>rdf.utils</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- <encoding>utf-8</encoding>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.scala-tools</groupId>
- <artifactId>maven-scala-plugin</artifactId>
- <version>2.15.2</version>
- <executions>
- <execution>
- <phase>generate-resources</phase>
- <goals>
- <goal>compile</goal>
- <goal>testCompile</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <scalaVersion>${scala.version}</scalaVersion>
- <args>
- <arg>-target:jvm-1.7</arg>
- <arg>-deprecation</arg>
- </args>
- <charset>UTF-8</charset>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>${project.groupId}.${project.artifactId}.*</Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.scala-tools</groupId>
- <artifactId>maven-scala-plugin</artifactId>
- <configuration>
- <scalaVersion>${scala.version}</scalaVersion>
- </configuration>
- <version>2.14.1</version>
- </plugin>
- </plugins>
- </reporting>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/CollectedIter.scala
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/CollectedIter.scala b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/CollectedIter.scala
deleted file mode 100644
index ec36962..0000000
--- a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/CollectedIter.scala
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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.utils
-
-import java.util.ConcurrentModificationException
-import java.util.Iterator
-import _root_.scala.collection
-import collection.mutable._
-import collection.immutable
-import _root_.scala.collection.JavaConversions._
-import java.util.concurrent.locks.Lock
-
-/**
- *
- * A Collection that groups the elements of an iterator, giving a view over it as over a
- * sequence.
- *
- * The collection takes a function returning an iterator, in order to allow for cases where the
- * iterator needs to be called from the beginning again. i.e. when a ConcurrentModificationException
- * occurs and the iteration is repeated in a section used using the provided readLock.
- */
-class CollectedIter[T](iterCreator: () => Iterator[T], readLock: Lock) extends immutable.Seq[T] {
-
- def this(jList : java.util.List[T], readLock: Lock) = this(() => jList.iterator(), readLock)
- def this() = this( ()=> java.util.Collections.emptyList[T].iterator(),null)
-
- var iter = iterCreator()
- var firstIter = true
-
- private val collectedElems = new ArrayBuffer[T]()
-
- /**
- * This method allows the position to be expressed between parenthesis
- */
- def apply(pos : Int) = {
- ensureReadTill(pos)
- collectedElems(pos)
- }
-
-
- /**
- * returns a new fully expanded and sorted CollectediterCreator
- */
- def sort(lt : (T,T) => Boolean) = {
- val sortedElems = iterator.toList.sortWith(lt)
- //TODO this re-expands everything, return sorted-list directly
- new CollectedIter[T](sortedElems, readLock)
-
- }
-
- /**
- * Operator style syntax to access a position.
- */
- def %(pos: Int) = apply(pos)
-
- private def ensureReadTill(pos: Int) {
- try {
-
- while (iter.hasNext && (collectedElems.length-1 <= pos)) {
- val next = iter.next()
- if (firstIter || !collectedElems.contains(next)) {
- collectedElems += next
- }
- }
- } catch {
- case e: ConcurrentModificationException => {
- readLock.lock()
- try {
- iter = iterCreator()
- firstIter = false
- //going beyond pos, do reduce chance we have to aquire another lock
- val biggerPos = if (pos < (Integer.MAX_VALUE - 100)) {
- pos + 100
- } else {
- Integer.MAX_VALUE
- }
- while (iter.hasNext && (collectedElems.length-1 <= biggerPos)) {
- val next = iter.next()
- if (!collectedElems.contains(next)) {
- collectedElems += next
- }
- }
- } finally {
- readLock.unlock()
- }
- }
- case e: Exception => throw e
- }
- }
-
- override def length : Int = {
- length(Integer.MAX_VALUE)
- }
-
- /**
- * The value returned is same or less than the length of the collection,
- * the underlying Iterator isn't expanded till more than <code>max</code>. If
- * the result is smaller than max it is the length of the collection.
- */
- def length(max: Int) : Int = {
- ensureReadTill(max)
- collectedElems.length
- }
-
- override def toString() = {
- if (length(1) > 0) {
- apply(0).toString
- } else {
- "empty"
- }
- }
-
- override def iterator = {
- ensureReadTill(Integer.MAX_VALUE)
- collectedElems.iterator
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzLiteral.scala
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzLiteral.scala b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzLiteral.scala
deleted file mode 100644
index c9fcc11..0000000
--- a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzLiteral.scala
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * 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.utils
-
-//import org.apache.clerezza.rdf.core.impl.{TypedLiteralImpl, PlainLiteralImpl}
-import org.apache.clerezza.rdf.ontologies.XSD
-import org.apache.commons.rdf.Iri
-import org.apache.commons.rdf.Language
-import org.apache.commons.rdf.Literal
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl
-import org.apache.commons.rdf.impl.utils.TypedLiteralImpl
-//import org.apache.commons.rdf.core.{TypedLiteral, Language, PlainLiteral, Iri}
-
-object EzLiteral extends EzLiteralImplicits
-
-trait EzLiteralImplicits {
-
- implicit def string2lit(str: String) = new EzLiteral(str)
-
-}
-
-/**
- * An EzLiteral is a typed string literal - ie, just a String literal - that comes with N3/turtle like methods
- * to map to other types of literals.
- *
- * This makes it useful when combined with the EzLiteralImplicit for writing out literals
- *
- * <code>
- * "ABCDEFGHIJKLMN" -- a plain string converted to a EzLiteral
- * "some text in english".lang(en) -- an english literal
- * "1234"^^XSD.int -- a number
- * </code>
- *
- * @author bblfish
- */
-class EzLiteral(string: String) extends TypedLiteralImpl(string,XSD.string) {
-
- /**
- * @return a plain literal with language specified by lang
- */
- def lang(lng: String): Literal = lang(new Language(lng))
-
- /**
- * @return a plain literal with language specified by lang
- */
- def lang(lng: Language): Literal = new PlainLiteralImpl(string, lng)
-
- /**
- * Map to a Typed Literal of given type
- */
- def ^^(typ: Iri): Literal = new TypedLiteralImpl(string, typ)
-
- /**
- * alias for iri
- */
- @deprecated(message ="use `iri`", since="1.0.0")
- def uri = iri
-
- /**
- * Map to an IRI of given lexical form
- */
- def iri = new Iri(string)
-
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzMGraph.scala
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzMGraph.scala b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzMGraph.scala
deleted file mode 100644
index 6ddb92b..0000000
--- a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/EzMGraph.scala
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.utils
-
-import org.apache.clerezza.rdf.core._
-import org.apache.clerezza.rdf.core.impl._
-import org.apache.commons.rdf.BlankNode
-import org.apache.commons.rdf.BlankNodeOrIri
-import org.apache.commons.rdf.Graph
-import org.apache.commons.rdf.Iri
-import org.apache.commons.rdf.RdfTerm
-import org.apache.commons.rdf.Triple
-import org.apache.commons.rdf.impl.utils.AbstractGraph
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph
-import scala.collection.mutable.HashMap
-
-
-/**
- * EzGraph enhances graph writing, it can make writing rdf graphs in code a lot more
- * readable, as it avoids a lot of repetition.
- *
- * @param graph: a Triple collection
- * @author hjs, reto
- */
-class EzGraph(val baseTc: Graph) extends AbstractGraph with TcDependentConversions {
-
-
- def this() = this (new SimpleGraph())
-
- def performFilter(subject: BlankNodeOrIri, predicate: Iri,
- obj: RdfTerm): java.util.Iterator[Triple] = baseTc.filter(subject, predicate, obj)
-
- override def performSize = baseTc.size
-
- override def add(t: Triple) = baseTc.add(t)
-
- /**
- * Add all triples into the other graph to this one
- */
- def +=(other: Graph) = {
- if (baseTc ne other) baseTc.addAll(other)
- }
-
- /**
- * create a new bnode
- */
- def bnode = blankNode
-
- def blankNode: BlankNode = {
- new BlankNode
- }
-
- private val namedBnodes = new HashMap[String,BlankNode]
-
- /**
- * create a new named bnode based EzGraphNode with the preferred writing style
- */
- def b_(name: String): BlankNode = {
- namedBnodes.get(name) match {
- case Some(bnode) => bnode
- case None => {
- val bn = new BlankNode
- namedBnodes.put(name, bn);
- bn
- }
- }
- }
-
-}
-
-
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/NameSpace.scala
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/NameSpace.scala b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/NameSpace.scala
deleted file mode 100644
index 19be8aa..0000000
--- a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/NameSpace.scala
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.utils
-
-import org.apache.commons.rdf.Iri
-
-/**
- * A IRI-namespace prefix
- */
-class NameSpace(prefix: String) {
-
- /**
- * returns a Iri applying this namespace prefix to the given symbol
- */
- def +(s: Symbol) = new Iri(prefix + s.name)
-
- /**
- * returns a Iri applying this prefix to the given string
- */
- def +(s: String) = new Iri(prefix + s)
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
deleted file mode 100644
index 8af2452..0000000
--- a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/Preamble.scala
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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.utils
-
-
-import org.apache.clerezza.rdf.ontologies.XSD
-import org.apache.clerezza.rdf.utils.GraphNode
-import java.math.BigInteger
-import java.net.URI
-import java.net.URL
-import java.util.Date
-import org.apache.clerezza.rdf.core._
-import org.apache.commons.rdf.Graph
-import org.apache.commons.rdf.Iri
-import org.apache.commons.rdf.Literal
-import org.apache.commons.rdf.RdfTerm
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph
-import org.apache.commons.rdf.impl.utils.simple.SimpleImmutableGraph
-
-/**
-* This object provides the implicit conversions. Typically this is used by
-* adding
-* {{{
-* import org.apache.clerezza.rdf.scala.utils.Preamble._
-* }}} near the top of the
-* file using SCB Utilities for Scala
-*
-* @author bblfish, reto
-*/
-object Preamble extends TcIndependentConversions {
-
-}
-
-/**
-* This class provides the implicit conversions of its companion Object and
-* additional conversions that require an evaluation graph, i.e. the conversion
-* from a resource to a RichGraphNode.
-*
-* Typically this is used by
-* adding
-* {{{
-* val preamble = new org.apache.clerezza.rdf.scala.utils.Preamble(myGraph)
-* import preamble._
-* }}}
-* before the
-* code section using the conversions
-*
-* @author bblfish, reto
-*/
-class Preamble(val baseTc: Graph) extends TcDependentConversions {
-
-}
-protected trait TcDependentConversions extends TcIndependentConversions {
-
- def baseTc: Graph
-
- implicit def toRichGraphNode(resource: RdfTerm) = {
- new RichGraphNode(new GraphNode(resource, baseTc))
- }
-}
-
-protected trait TcIndependentConversions extends EzLiteralImplicits {
- implicit def toRichGraphNode(node: GraphNode) = {
- new RichGraphNode(node)
- }
-
- implicit def toFirstElement(c: CollectedIter[RichGraphNode]) = {
- if (c.length(1) > 0) {
- c(0)
- } else {
- TcIndependentConversions.emptyLiteral
- }
- }
-
- private val litFactory = LiteralFactory.getInstance
-
-
- implicit def lit2String(lit: Literal) = lit.getLexicalForm
-
- implicit def date2lit(date: Date) = litFactory.createTypedLiteral(date)
-
- implicit def int2lit(int: Int) = litFactory.createTypedLiteral(int)
-
- implicit def bigint2lit(bint: BigInt) = litFactory.createTypedLiteral(bint.underlying())
-
- implicit def bigint2lit(bigInt: BigInteger) = litFactory.createTypedLiteral(bigInt)
-
- implicit def bool2lit(boolean: Boolean) = litFactory.createTypedLiteral(boolean)
-
- implicit def long2lit(long: Long) = litFactory.createTypedLiteral(long)
-
- implicit def double2lit(double: Double) = litFactory.createTypedLiteral(double)
-
- implicit def uriRef2Prefix(uriRef: Iri) = new NameSpace(uriRef.getUnicodeString)
-
- implicit def URItoIri(uri: URI) = new Iri(uri.toString)
-
- implicit def URLtoIri(url: URL) = new Iri(url.toExternalForm)
-
-}
-protected object TcIndependentConversions {
- val emptyGraph = new SimpleImmutableGraph(new SimpleGraph)
- val emptyLiteral = new RichGraphNode(new GraphNode(new PlainLiteralImpl(""), emptyGraph))
-
-}
-
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/RichGraphNode.scala
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/RichGraphNode.scala b/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/RichGraphNode.scala
deleted file mode 100644
index 4f2addc..0000000
--- a/rdf.scala.utils/src/main/scala/org/apache/clerezza/rdf/scala/utils/RichGraphNode.scala
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * 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.utils
-
-import org.apache.clerezza.rdf.core.LiteralFactory
-import org.apache.clerezza.rdf.ontologies.RDF
-import org.apache.clerezza.rdf.utils.GraphNode
-import java.util.Iterator
-import _root_.scala.collection.JavaConversions._
-import _root_.scala.reflect.Manifest
-import org.apache.commons.rdf.Graph
-import org.apache.commons.rdf.Iri
-import org.apache.commons.rdf.Literal
-import org.apache.commons.rdf.RdfTerm
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph
-import org.apache.clerezza.rdf.utils.UnionGraph
-
-
-/**
- * A RichGraphNode decorates A GraphNode with additional method to be part on a DSL-style scala library.
- *
- * The default constructor is same a the GraphNode constructor, i.e. it takes the node and its context
- * Triple-collection
- *
- * @param resource the node represented by this RichGraphNode
- * @param graph the Graph that describes the resource
- */
-class RichGraphNode(resource: RdfTerm, graph: Graph ) extends GraphNode(resource, graph) {
-
- /**
- * Construct a RichGraphNode given an existing [[GraphNde]]
- *
- * @param node The GraphNode to be wrapped
- */
- def this(node: GraphNode) = this(node.getNode, node.getGraph)
-
- /**
- * Operator syntax shortcut to get all objects as <code>RichGraphNode</code>
- *
- * @return all objects of the specified property of the node wrapped by this object
- */
- def /(property: Iri): CollectedIter[RichGraphNode] = {
- new CollectedIter[RichGraphNode](() => new GraphNodeIter(getObjects(property)), readLock)
- }
-
- /**
- * Operator syntax shortcut to get all subjects as <code>RichGraphNode</code>ref
- *
- * @param property the property for which the subjects pointing to this node by that property are requested
- * @return the matching resources
- */
- def /-(property: Iri): CollectedIter[RichGraphNode] = {
- new CollectedIter[RichGraphNode](() => new GraphNodeIter(getSubjects(property)), readLock)
- }
-
- /**
- * Get the elements of the rdf:List represented by this node
- * @return a List with the elements of the rdf:List represented by this node
- */
- def !! = (for (listElem <- asList) yield {
- new RichGraphNode(new GraphNode(listElem, getGraph))
- }).toList
-
- /**
- * get a specified of the rdf:List represented by this node
- *
- * @return the specified index value
- */
- def %!!(index: Int) = new RichGraphNode(new GraphNode(asList.get(index),
- getGraph))
-
- /**
- * produces a default String representation for the node, this is the lexical form of literals,
- * the unicode-string for Iri and for BlankNodes the value returned by toString
- *
- * @return the default string representation of the node
- */
- def * : String = {
- getNode() match {
- case lit: Literal => lit.getLexicalForm
- case uri: Iri => uri.getUnicodeString
- case wrappedNode => wrappedNode.toString
- }
- }
-
- private def asClass[T](clazz : Class[T]) : T= {
- val typedLiteral = getNode().asInstanceOf[Literal]
- clazz match {
- case c if(c == classOf[Boolean]) => LiteralFactory.getInstance().createObject(
- classOf[java.lang.Boolean], typedLiteral).booleanValue.asInstanceOf[T]
- case _ => LiteralFactory.getInstance().createObject(clazz, typedLiteral)
- }
- }
-
- /**
- * Creates an instance of specified Class-Type representing the value of the literal wrapped by this
- * <code>GraphNode</code>
- *
- * @return the literal represented by this node as instance of the specified type
- */
- def as[T](implicit m: Manifest[T]): T = {
- asClass(m.runtimeClass.asInstanceOf[Class[T]])
- }
-
- /**
- * Operator syntax shortcut to get the <code>RdfTerm</code> wrapped by this
- * <code>GraphNode</code>
- *
- * @return the node represented by this GraphNode as RdfTerm, same as <code>getNode</code>
- */
- def ! = {
- getNode()
- }
-
- private class GraphNodeIter[T <: RdfTerm](base: Iterator[T]) extends Iterator[RichGraphNode] {
- override def hasNext() = {
- base.hasNext();
- }
-
- override def next() : RichGraphNode = {
- new RichGraphNode(new GraphNode(base.next(), getGraph));
- }
-
- override def remove() {
- base.remove()
- }
- }
-
- /**
- *Sets the RDF:type of the subject */
- def a(rdfclass: Iri): RichGraphNode = {
- addProperty(RDF.`type`, rdfclass)
- return this
- }
-
- /*
- * create an RichGraphNode from this one where the backing graph is protected from writes by a new
- * SimpleGraph.
- */
- def protect(): RichGraphNode = new RichGraphNode(getNode, new UnionGraph(new SimpleGraph(), graph))
-
-
- /**
- * relate the subject via the given relation to....
- */
- def --(rel: RdfTerm): DashTuple = new DashTuple(rel)
-
- def --(rel: RichGraphNode): DashTuple = new DashTuple(rel.getNode)
-
-
- /**
- * relate the subject via the inverse of the given relation to....
- */
- def <--(tuple: RichGraphNode#DashTuple): RichGraphNode = {
- val inversePropertyRes = tuple.first.getNode
- val inverseProperty: Iri = inversePropertyRes match {
- case p: Iri => p
- case _ => throw new RuntimeException("DashTuple must be a Iri")
- }
- RichGraphNode.this.addInverseProperty(inverseProperty, tuple.second)
- RichGraphNode.this
- }
-
-
- /** class for Inverse relations with the current RichGraphNode.ref as object */
- //TODO add support for adding many for symmetry reasons
-// class InverseDashTuple(rel: DashTuple) {
-//
-// /**
-// * ...to the following non literal
-// */
-// def --(subj: BlankNodeOrIri): RichGraphNode = {
-// RichGraphNode.this.addInverseProperty(rel, subj)
-// RichGraphNode.this
-// }
-//
-// /**
-// * ...to the following resource (given as a string)
-// */
-// def --(subj: String): RichGraphNode = --(new Iri(subj))
-//
-// /**
-// * ...to the following EzGraphNode
-// * (useful for opening a new parenthesis and specifying other things in more detail
-// */
-// def --(subj: GraphNode): RichGraphNode = {
-// --(subj.getNode.asInstanceOf[BlankNodeOrIri])
-// }
-// // since we can only have inverses from non literals (howto deal with bndoes?)
-// }
-
- /**
- * class for relations with the current RichGraphNode.ref as subject
- */
- class DashTuple(val second: RdfTerm) {
-
- val first = RichGraphNode.this
- /**
- * ...to the following non resource
- */
- def -->(obj: RdfTerm): RichGraphNode = {
- val property = second match {
- case u: Iri => u;
- case _ => throw new RuntimeException("Property must be a Iri")
- }
- RichGraphNode.this.addProperty(property, obj)
- RichGraphNode.this
- }
-
-
- /**
- * ...to the EzGraphNode, which is useful for opening a parenthesis.
- */
- def -->(sub: GraphNode): RichGraphNode = {
- //RichGraphNode.this + sub
- -->(sub.getNode)
- }
- /**
- * Add one relation for each member of the iterable collection
- */
- def -->>[T <: RdfTerm](uris: Iterable[T]): RichGraphNode = {
- for (u <- uris) -->(u)
- RichGraphNode.this
- }
- }
-}
-
-
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzMGraphTest.scala
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzMGraphTest.scala b/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzMGraphTest.scala
deleted file mode 100644
index 3e72d87..0000000
--- a/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/EzMGraphTest.scala
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * 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.utils
-
-import org.apache.commons.rdf.BlankNode
-import org.apache.commons.rdf.ImmutableGraph
-import org.apache.commons.rdf.Iri
-import org.apache.commons.rdf.Language
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl
-import org.apache.commons.rdf.impl.utils.TripleImpl
-import org.apache.commons.rdf.impl.utils.TypedLiteralImpl
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph
-import org.junit._
-import org.apache.clerezza.rdf.core._
-import impl._
-import Preamble._
-import org.apache.clerezza.rdf.ontologies._
-
-/**
- * @author bblfish, reto
- */
-class EzGraphTest {
-
- val bblfishModulus = """
- 9D ☮ 79 ☮ BF ☮ E2 ☮ F4 ☮ 98 ☮ BC ☮ 79 ☮ 6D ☮ AB ☮ 73 ☮ E2 ☮ 8B ☮ 39 ☮ 4D ☮ B5 26 ✜ 68 ✜ 49 ✜ EE ✜ 71 ✜ 87 ✜
- 06 ✜ 32 ✜ C9 ✜ 9F ✜ 3F ✜ 94 ✜ E5 ✜ CB ✜ 4D ✜ B5 12 ☮ 35 ☮ 13 ☮ 69 ☮ 60 ☮ 81 ☮ 58 ☮ 79 ☮ 66 ☮ F3 ☮ 79 ☮ 20 ☮
- 91 ☮ 6A ☮ 3F ☮ 42 5A ✜ F6 ✜ 54 ✜ 42 ✜ 88 ✜ B2 ✜ E9 ✜ 19 ✜ 4A ✜ 79 ✜ 87 ✜ 2E ✜ 62 ✜ 44 ✜ 2D ✜ 7C 06 ☽ 78 ☽ F8
- ☽ FD ☽ 52 ☽ 92 ☽ 6D ☽ CD ☽ D6 ☽ F3 ☽ 28 ☽ 6B ☽ 1F ☽ DB ☽ CB ☽ D3 F2 ☮ 08 ☮ 34 ☮ 72 ☮ A2 ☮ 12 ☮ 75 ☮ AE ☮ D1
- ☮ 09 ☮ 17 ☮ D0 ☮ 88 ☮ 4C ☮ 04 ☮ 8E 04 ☾ E5 ☾ BF ☾ D1 ☾ 41 ☾ 64 ☾ D1 ☾ F7 ☾ 89 ☾ 6D ☾ 8B ☾ B2 ☾ F2 ☾ 46 ☾ C0
- ☾ 56 87 ☮ 8D ☮ B8 ☮ 7C ☮ C6 ☮ FE ☮ E9 ☮ 61 ☮ 88 ☮ 08 ☮ 61 ☮ DD ☮ E3 ☮ B8 ☮ B5 ☮ 47 ♥
- """
-
- /**import some references in order to reduce dependencies */
-
- final val hex: Iri = new Iri("http://www.w3.org/ns/auth/cert#hex")
- final val identity: Iri = new Iri("http://www.w3.org/ns/auth/cert#identity")
- final val RSAPublicKey: Iri = new Iri("http://www.w3.org/ns/auth/rsa#RSAPublicKey")
- final val modulus: Iri = new Iri("http://www.w3.org/ns/auth/rsa#modulus")
- final val public_exponent: Iri = new Iri("http://www.w3.org/ns/auth/rsa#public_exponent")
-
- val henryUri: String = "http://bblfish.net/#hjs"
- val retoUri: String = "http://farewellutopia.com/reto/#me"
- val danbriUri: String = "http://danbri.org/foaf.rdf#danbri"
-
-
- private val tinyGraph: ImmutableGraph = {
- val gr = new SimpleGraph
- val reto = new BlankNode()
- val danny = new BlankNode()
- val henry = new Iri(henryUri)
-
- gr.add(new TripleImpl(reto, RDF.`type`, FOAF.Person))
- gr.add(new TripleImpl(reto, FOAF.name, new PlainLiteralImpl("Reto Bachman-Gmür", new Language("rm"))))
- //it is difficult to remember that one needs to put a string literal if one does not want to specify a language
- gr.add(new TripleImpl(reto, FOAF.title, new TypedLiteralImpl("Mr", XSD.string)))
- gr.add(new TripleImpl(reto, FOAF.currentProject, new Iri("http://clerezza.org/")))
- gr.add(new TripleImpl(reto, FOAF.knows, henry))
- gr.add(new TripleImpl(reto, FOAF.knows, danny))
-
- gr.add(new TripleImpl(danny, FOAF.name, new PlainLiteralImpl("Danny Ayers", new Language("en"))))
- gr.add(new TripleImpl(danny, RDF.`type`, FOAF.Person))
- gr.add(new TripleImpl(danny, FOAF.knows, henry))
- gr.add(new TripleImpl(danny, FOAF.knows, reto))
-
- gr.add(new TripleImpl(henry, FOAF.name, new TypedLiteralImpl("Henry Story", XSD.string))) //It is tricky to remember that one needs this for pure strings
- gr.add(new TripleImpl(henry, FOAF.currentProject, new Iri("http://webid.info/")))
- gr.add(new TripleImpl(henry, RDF.`type`, FOAF.Person))
- gr.add(new TripleImpl(henry, FOAF.knows, danny))
- gr.add(new TripleImpl(henry, FOAF.knows, reto))
-
- val pk = new BlankNode()
- gr.add(new TripleImpl(pk, RDF.`type`, RSAPublicKey))
- gr.add(new TripleImpl(pk, identity, henry))
- gr.add(new TripleImpl(pk, modulus, LiteralFactory.getInstance().createTypedLiteral(65537)))
- gr.add(new TripleImpl(pk, public_exponent, new TypedLiteralImpl(bblfishModulus, hex)))
- gr.getImmutableGraph
- }
-
-
- @Test
- def singleTriple {
- val expected = {
- val s = new SimpleGraph
- s.add(new TripleImpl(henryUri.iri, FOAF.knows, retoUri.iri))
- s.getImmutableGraph
- }
- val ez = new EzGraph() {
- henryUri.iri -- FOAF.knows --> retoUri.iri
- }
- Assert.assertEquals("The two graphs should be equals", expected, ez.getImmutableGraph)
- }
-
- @Test
- def inverseTriple {
- val expected = {
- val s = new SimpleGraph
- s.add(new TripleImpl(retoUri.iri, FOAF.knows, henryUri.iri))
- s.getImmutableGraph
- }
- val ez = new EzGraph() {
- henryUri.iri <-- FOAF.knows -- retoUri.iri
- }
- Assert.assertEquals("The two graphs should be equals", expected, ez.getImmutableGraph)
- }
-
- @Test
- def usingAsciiArrows {
- val ez = new EzGraph() {(
- b_("reto").a(FOAF.Person) -- FOAF.name --> "Reto Bachman-Gmür".lang("rm")
- -- FOAF.title --> "Mr"
- -- FOAF.currentProject --> "http://clerezza.org/".iri
- -- FOAF.knows --> (
- "http://bblfish.net/#hjs".iri.a(FOAF.Person)
- -- FOAF.name --> "Henry Story"
- -- FOAF.currentProject --> "http://webid.info/".iri
- -- FOAF.knows -->> List(b_("reto"), b_("danny"))
- //one need to list properties before inverse properties, or use brackets
- <-- identity -- (
- bnode.a(RSAPublicKey) //. notation because of precedence of operators
- -- modulus --> 65537
- -- public_exponent --> (bblfishModulus^^hex) // brackets needed due to precedence
- )
- )
- -- FOAF.knows --> (
- b_("danny").a(FOAF.Person)
- -- FOAF.name --> "Danny Ayers".lang("en")
- -- FOAF.knows --> "http://bblfish.net/#hjs".iri //knows
- -- FOAF.knows --> b_("reto")
- )
- )}
- Assert.assertEquals("the two graphs should be of same size",tinyGraph.size,ez.size)
- Assert.assertEquals("Both graphs should contain exactly the same triples",tinyGraph,ez.getImmutableGraph)
- //We can add triples by creating a new anonymous instance
- new EzGraph(ez) {(
- "http://bblfish.net/#hjs".iri -- FOAF.name --> "William"
- -- 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)
- }
-
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/RichGraphNodeTest.scala
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/RichGraphNodeTest.scala b/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/RichGraphNodeTest.scala
deleted file mode 100644
index 2029c03..0000000
--- a/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/RichGraphNodeTest.scala
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * 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.utils
-
-import org.apache.clerezza.rdf.utils._
-import org.apache.clerezza.rdf.core._
-import org.apache.clerezza.rdf.core.impl._
-import org.apache.clerezza.rdf.ontologies._
-import org.apache.commons.rdf.BlankNode
-import org.apache.commons.rdf.Graph
-import org.apache.commons.rdf.Iri
-import org.apache.commons.rdf.Language
-import org.apache.commons.rdf.Literal
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl
-import org.apache.commons.rdf.impl.utils.TripleImpl
-import org.apache.commons.rdf.impl.utils.TypedLiteralImpl
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph
-import org.junit._
-import Preamble._
-
-class RichGraphNodeTest {
-
- private val johnUri = new Iri("http://example.org/john")
- private val susanneUri = new Iri("http://example.org/susanne")
- private val listUri = new Iri("http://example.org/list")
- private val greetingsUri = new Iri("http://example.org/greetings")
- private val billBlankNode = new BlankNode()
- private var node : RichGraphNode = null;
- private var mGraph = new SimpleGraph()
-
- @Before
- def prepare() = {
- mGraph.add(new TripleImpl(johnUri, FOAF.name, new PlainLiteralImpl("John")));
- mGraph.add(new TripleImpl(johnUri, FOAF.nick, new PlainLiteralImpl("johny")));
- mGraph.add(new TripleImpl(johnUri, FOAF.name, new PlainLiteralImpl("Johnathan Guller")));
- mGraph.add(new TripleImpl(johnUri, FOAF.knows, billBlankNode))
- mGraph.add(new TripleImpl(johnUri, RDF.`type`, FOAF.Person));
- mGraph.add(new TripleImpl(billBlankNode, FOAF.nick, new PlainLiteralImpl("Bill")));
- mGraph.add(new TripleImpl(billBlankNode, FOAF.name, new PlainLiteralImpl("William")));
- mGraph.add(new TripleImpl(billBlankNode, RDF.`type`, FOAF.Person));
- mGraph.add(new TripleImpl(susanneUri, FOAF.knows, johnUri));
- mGraph.add(new TripleImpl(susanneUri, FOAF.name, new PlainLiteralImpl("Susanne")));
- mGraph.add(new TripleImpl(susanneUri, RDF.`type`, FOAF.Person));
- val rdfList = new RdfList(listUri, mGraph);
- rdfList.add(johnUri)
- rdfList.add(new PlainLiteralImpl("foo"))
- rdfList.add(new PlainLiteralImpl("bar"))
- mGraph.add(new TripleImpl(johnUri, SKOS04.related, listUri))
- val litEn = new PlainLiteralImpl("hello",
- new Language("en"))
- val litFr = new PlainLiteralImpl("satul",
- new Language("fr"))
- mGraph.add(new TripleImpl(greetingsUri, RDF.value, litEn))
- mGraph.add(new TripleImpl(greetingsUri, RDF.value, litFr))
- node = new GraphNode(johnUri, mGraph)
- }
-
- @Test
- def testBaseGraph {
- val preamble = new Preamble(mGraph)
- import preamble._
- def asGn(gn: GraphNode) = gn
- val johnUriNode = asGn(johnUri)
- Assert.assertEquals(johnUriNode, node)
- }
-
- @Test
- def testSlash = {
- val rNode = new RichGraphNode(node)
- Assert.assertEquals(new PlainLiteralImpl("johny"), (rNode/FOAF.nick)(0).getNode)
- Assert.assertEquals(2, (rNode/FOAF.name).length(20))
- val stringNames = (for(name <- (rNode/FOAF.name).iterator) yield {
- name.toString
- }).toList
- Assert.assertTrue(stringNames.contains("\"Johnathan Guller\""))
- Assert.assertTrue(stringNames.contains("\"John\""))
- }
-
- @Test
- def testIterate = {
- val simple: Graph = new SimpleGraph();
- val node = new GraphNode(new BlankNode(), simple);
- node.addProperty(DCTERMS.provenance, new Iri("http://example.org/foo"));
- node.addProperty(DCTERMS.language, new Iri("http://www.bluewin.ch/"));
- simple.add(new TripleImpl(new Iri("http://www.bluewin.ch/"),RDF.`type`, RDFS.Container));
- node.addProperty(RDF.`type`, PLATFORM.HeadedPage);
- node.addProperty(RDF.`type`, RDFS.Class);
- val test: CollectedIter[RichGraphNode] = node/DCTERMS.language/RDF.`type`;
- Assert.assertEquals(1, test.length)
- var counter = 0;
- for(k <- test) { counter = counter + 1 }
- Assert.assertEquals(1, counter)
- }
-
- @Test
- def testInverse = {
- val rNode = new RichGraphNode(node)
- Assert.assertEquals(1, (rNode/-FOAF.knows).length)
- }
-
- @Test
- def testMissingProperty = {
- val rNode = new RichGraphNode(node)
- Assert.assertEquals(0, (rNode/FOAF.thumbnail).length)
- Assert.assertEquals("", rNode/FOAF.thumbnail*)
-
- }
-
- @Test
- def testInverseImplicit = {
- Assert.assertEquals(1, (node/-FOAF.knows).length)
- }
-
- @Test
- def testPath = {
- Assert.assertEquals(1, (node/-FOAF.knows).length)
- Assert.assertEquals(new PlainLiteralImpl("Susanne"), node/-FOAF.knows%0/FOAF.name%0!)
- Assert.assertEquals(new PlainLiteralImpl("Susanne"), ((node/-FOAF.knows)(0)/FOAF.name)(0)!)
- Assert.assertEquals(new PlainLiteralImpl("Susanne"), node/-FOAF.knows/FOAF.name!)
- Assert.assertEquals(new PlainLiteralImpl("Bill"), node/FOAF.knows/FOAF.nick!)
- Assert.assertEquals("Bill", (node/FOAF.knows/FOAF.nick)(0)*)
- Assert.assertEquals("Bill", node/FOAF.knows/FOAF.nick*)
- }
-
- @Test
- def testLists = {
- Assert.assertEquals(new PlainLiteralImpl("foo"),(node/SKOS04.related).asList().get(1))
- Assert.assertEquals(new PlainLiteralImpl("foo"), (node/SKOS04.related%0!!)(1)!)
- Assert.assertEquals(new PlainLiteralImpl("foo"),
- (for (value <- node/SKOS04.related%0!!) yield value!).toList(1))
- Assert.assertEquals(new PlainLiteralImpl("bar"),
- (for (value <- node/SKOS04.related%0!!) yield value!).toList(2))
- Assert.assertEquals(new PlainLiteralImpl("foo"), node/SKOS04.related%0%!!1!)
- }
-
- @Test
- def sortProperties = {
- Assert.assertEquals(new PlainLiteralImpl("bar"), (node/SKOS04.related%0!!).sortWith((a,b) => ((a*) < (b*)))(0)!)
- Assert.assertEquals(johnUri, (node/SKOS04.related%0!!).sortWith((a,b) => ((a*) > (b*)))(0)!)
- }
-
- @Test
- def literalAsObject = {
- val dateLiteral = new TypedLiteralImpl("2009-01-01T01:33:58Z",
- new Iri("http://www.w3.org/2001/XMLSchema#dateTime"))
- val node = new GraphNode(dateLiteral, new SimpleGraph())
- Assert.assertNotNull(node.as[java.util.Date])
- }
-
- @Test
- def literalLanguage = {
- node = new GraphNode(greetingsUri, mGraph)
- val lang = new Language("en")
- val enValue = (node/RDF.value).find(l=>(l!).asInstanceOf[Literal].getLanguage == lang).get
- Assert.assertEquals("hello", enValue*)
- }
-
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/TypeConversionTest.scala
----------------------------------------------------------------------
diff --git a/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/TypeConversionTest.scala b/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/TypeConversionTest.scala
deleted file mode 100644
index 5798e86..0000000
--- a/rdf.scala.utils/src/test/scala/org/apache/clerezza/rdf/scala/utils/TypeConversionTest.scala
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.clerezza.rdf.scala.utils
-
-/*
- * 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.
- */
-import org.apache.commons.rdf.Iri
-import org.apache.commons.rdf.Language
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl
-import org.apache.commons.rdf.impl.utils.TripleImpl
-import org.apache.commons.rdf.impl.utils.TypedLiteralImpl
-import org.junit._
-import org.apache.clerezza.rdf.core._
-
-class TypeConversionTest {
-
- private val literalFactory = LiteralFactory.getInstance()
-
- import Preamble._
-
- @Test
- def useStringAsObject {
- val t = new TripleImpl(new Iri(("http://example.org/subject")), new Iri(("http://example.org/predicate")), "a value")
- Assert.assertEquals(literalFactory.createTypedLiteral("a value"), t.getObject)
- }
-
- /*@Test
- def useStringWithLanguageTag {
- val t = new TripleImpl(new Iri(("http://example.org/subject")), new Iri(("http://example.org/predicate")), "a value"("en"))
- Assert.assertEquals(new PlainLiteralImpl("a value", new Language("en")), t.getObject)
- }*/
-
- @Test
- def useStringWithLanguageTag {
- val lit = new PlainLiteralImpl("a value", new Language("en"))
- val t = new TripleImpl(new Iri(("http://example.org/subject")), new Iri(("http://example.org/predicate")), "a value" lang "en")
- Assert.assertEquals(lit, t.getObject)
- }
-
- @Test
- def useStringWithType {
- val typeUri = new Iri("http://example.org/dt")
- val t = new TripleImpl(new Iri(("http://example.org/subject")), new Iri(("http://example.org/predicate")), "a value"^^typeUri)
- Assert.assertEquals(new TypedLiteralImpl("a value", typeUri), t.getObject)
- }
-
- @Test
- def literaToString {
- val lit = literalFactory.createTypedLiteral("a value")
- val s: String = lit
- Assert.assertEquals("a value", s)
- }
-
- @Test
- def dotUri {
- val t = new TripleImpl(new Iri(("http://example.org/subject")), new Iri(("http://example.org/predicate")), "http://example.org".iri)
- Assert.assertEquals(new Iri("http://example.org"), t.getObject)
- }
-
-}
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf/pom.xml
----------------------------------------------------------------------
diff --git a/rdf/pom.xml b/rdf/pom.xml
index 6ce2eff..ba6f7e4 100644
--- a/rdf/pom.xml
+++ b/rdf/pom.xml
@@ -47,6 +47,7 @@
<module>core.test</module>
<module>jena</module>
<module>metadata</module>
+ <module>scala.utils</module>
<module>schemagen/main</module>
<module>schemagen/maven-plugin</module>
<module>ontologies</module>
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf/scala.utils/LICENSE
----------------------------------------------------------------------
diff --git a/rdf/scala.utils/LICENSE b/rdf/scala.utils/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/rdf/scala.utils/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
http://git-wip-us.apache.org/repos/asf/clerezza/blob/4d35191b/rdf/scala.utils/pom.xml
----------------------------------------------------------------------
diff --git a/rdf/scala.utils/pom.xml b/rdf/scala.utils/pom.xml
new file mode 100644
index 0000000..7d8f99e
--- /dev/null
+++ b/rdf/scala.utils/pom.xml
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<!--
+
+ 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.
+
+-->
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>clerezza</artifactId>
+ <groupId>org.apache.clerezza</groupId>
+ <version>7-SNAPSHOT</version>
+ <relativePath>../parent</relativePath>
+ </parent>
+ <groupId>org.apache.clerezza</groupId>
+ <artifactId>rdf.scala.utils</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>bundle</packaging>
+ <name>Clerezza - RDF Scala Utilities</name>
+ <description>OSGi bundle providing utilities for accessing Clerezza RDF Commons
+ Graphs with Scala. Adding import
+ "org.apache.clerezza.rdf.scala.utils.Preamble._" 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,
+ e.g. "node/-FOAF.knows%2/FOAF.name%0!", see the ScalaDocs for RichGraphNode
+ for all operations
+ </description>
+ <dependencies>
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-library</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.clerezza</groupId>
+ <artifactId>rdf.core</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.clerezza</groupId>
+ <artifactId>rdf.utils</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <encoding>utf-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.scala-tools</groupId>
+ <artifactId>maven-scala-plugin</artifactId>
+ <version>2.15.2</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>compile</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <scalaVersion>${scala.version}</scalaVersion>
+ <args>
+ <arg>-target:jvm-1.7</arg>
+ <arg>-deprecation</arg>
+ </args>
+ <charset>UTF-8</charset>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>${project.groupId}.${project.artifactId}.*</Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.scala-tools</groupId>
+ <artifactId>maven-scala-plugin</artifactId>
+ <configuration>
+ <scalaVersion>${scala.version}</scalaVersion>
+ </configuration>
+ <version>2.14.1</version>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
\ No newline at end of file