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 2010/07/20 17:26:32 UTC
svn commit: r965879 - in /incubator/clerezza/issues/CLEREZZA-218:
org.apache.clerezza.platform.enrichment/
org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/platform/
org.apache.clerezza.platform.enrichment/src/main/java/org/apa...
Author: reto
Date: Tue Jul 20 15:26:32 2010
New Revision: 965879
URL: http://svn.apache.org/viewvc?rev=965879&view=rev
Log:
CLEREZZA-218: introduced enrichment project into the platform, applying rdf enrichment to the content graph using enricher services (unfinished skeleton)
Added:
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/
- copied from r964941, incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/nbactions.xml
- copied unchanged from r965411, incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/nbactions.xml
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/pom.xml
- copied, changed from r965740, incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/pom.xml
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/platform/
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/platform/rdf/
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/EnrichmentTcProvider.java
Removed:
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/rdf/enrichment/
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/test/java/org/apache/clerezza/rdf/enrichment/
Modified:
incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/src/main/java/org/apache/clerezza/rdf/enrichment/EnrichmentTriples.java
Copied: incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/pom.xml (from r965740, incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/pom.xml)
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/pom.xml?p2=incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/pom.xml&p1=incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/pom.xml&r1=965740&r2=965879&rev=965879&view=diff
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/pom.xml (original)
+++ incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/pom.xml Tue Jul 20 15:26:32 2010
@@ -6,11 +6,11 @@
<version>0.8-incubating-SNAPSHOT</version>
</parent>
<groupId>org.apache.clerezza</groupId>
- <artifactId>org.apache.clerezza.rdf.enrichment.core</artifactId>
+ <artifactId>org.apache.clerezza.platform.enrichment</artifactId>
<packaging>bundle</packaging>
<version>0.1-incubating-SNAPSHOT</version>
- <name>Clerezza - SCB Enrichment Core</name>
- <description>The core part of SCB Enrichment</description>
+ <name>Clerezza - Platform RDF Enrichment</name>
+ <description>Provides a Content-Graph Extension using Enrichers</description>
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -19,30 +19,16 @@
</dependency>
<dependency>
<groupId>org.apache.clerezza</groupId>
- <artifactId>org.apache.clerezza.rdf.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>org.apache.clerezza.utils</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>org.apache.clerezza.rdf.jena.serializer</artifactId>
- <scope>test</scope>
+ <artifactId>org.apache.clerezza.platform</artifactId>
</dependency>
<dependency>
<groupId>org.apache.clerezza</groupId>
- <artifactId>org.apache.clerezza.rdf.jena.parser</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.clerezza</groupId>
- <artifactId>org.apache.clerezza.rdf.ontologies</artifactId>
+ <artifactId>org.apache.clerezza.rdf.core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.clerezza</groupId>
- <artifactId>org.apache.clerezza.rdf.utils</artifactId>
- <scope>test</scope>
+ <artifactId>org.apache.clerezza.rdf.enrichment.core</artifactId>
+ <version>0.1-incubating-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Added: incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/EnrichmentTcProvider.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/EnrichmentTcProvider.java?rev=965879&view=auto
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/EnrichmentTcProvider.java (added)
+++ incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.platform.enrichment/src/main/java/org/apache/clerezza/platform/rdf/enrichment/EnrichmentTcProvider.java Tue Jul 20 15:26:32 2010
@@ -0,0 +1,113 @@
+/*
+ * 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.platform.rdf.enrichment;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.clerezza.platform.Constants;
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.EntityAlreadyExistsException;
+import org.apache.clerezza.rdf.core.access.EntityUndeletableException;
+import org.apache.clerezza.rdf.core.access.NoSuchEntityException;
+import org.apache.clerezza.rdf.core.access.WeightedTcProvider;
+
+/**
+ * Provides a read-only MGraph with the name http://zz.localhost/enrichment.graph
+ * containing the enrichments provided by all available services of type
+ * Enricher on the content graph
+ *
+ * @author reto
+ */
+public class EnrichmentTcProvider implements WeightedTcProvider {
+
+ public static final UriRef ENRICHMENT_GRAPH_URI = new UriRef("http://zz.localhost/enrichment.graph");
+
+ public static final String SYSTEM_GRAPH_FILTER =
+ "(name="+ Constants.SYSTEM_GRAPH_URI_STRING +")";
+
+ @Override
+ public Graph getGraph(UriRef name) throws NoSuchEntityException {
+ throw new NoSuchEntityException(name);
+ }
+
+ @Override
+ public MGraph getMGraph(UriRef name) throws NoSuchEntityException {
+ if (ENRICHMENT_GRAPH_URI.equals(name)) {
+ return getEnrichmentGraph();
+ }
+ throw new NoSuchEntityException(name);
+ }
+
+ @Override
+ public TripleCollection getTriples(UriRef name) throws NoSuchEntityException {
+ if (ENRICHMENT_GRAPH_URI.equals(name)) {
+ return getEnrichmentGraph();
+ }
+ throw new NoSuchEntityException(name);
+ }
+
+ @Override
+ public Set<UriRef> listGraphs() {
+ return new HashSet<UriRef>(0);
+ }
+
+ @Override
+ public Set<UriRef> listMGraphs() {
+ return Collections.singleton(ENRICHMENT_GRAPH_URI);
+ }
+
+ @Override
+ public Set<UriRef> listTripleCollections() {
+ return Collections.singleton(ENRICHMENT_GRAPH_URI);
+ }
+
+ @Override
+ public MGraph createMGraph(UriRef name) throws UnsupportedOperationException, EntityAlreadyExistsException {
+ throw new UnsupportedOperationException("creating entities not supported");
+ }
+
+ @Override
+ public Graph createGraph(UriRef name, TripleCollection triples) throws UnsupportedOperationException, EntityAlreadyExistsException {
+ throw new UnsupportedOperationException("creating entities not supported");
+ }
+
+ @Override
+ public void deleteTripleCollection(UriRef name) throws UnsupportedOperationException, NoSuchEntityException, EntityUndeletableException {
+ throw new UnsupportedOperationException("deleting entities not supported");
+ }
+
+ @Override
+ public Set<UriRef> getNames(Graph graph) {
+ return new HashSet<UriRef>(0);
+ }
+
+ @Override
+ public int getWeight() {
+ return 0;
+ }
+
+ private MGraph getEnrichmentGraph() {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+}
Modified: incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/src/main/java/org/apache/clerezza/rdf/enrichment/EnrichmentTriples.java
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/src/main/java/org/apache/clerezza/rdf/enrichment/EnrichmentTriples.java?rev=965879&r1=965878&r2=965879&view=diff
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/src/main/java/org/apache/clerezza/rdf/enrichment/EnrichmentTriples.java (original)
+++ incubator/clerezza/issues/CLEREZZA-218/org.apache.clerezza.rdf.enrichment/org.apache.clerezza.rdf.enrichment.core/src/main/java/org/apache/clerezza/rdf/enrichment/EnrichmentTriples.java Tue Jul 20 15:26:32 2010
@@ -28,6 +28,7 @@ import org.apache.clerezza.rdf.core.Reso
import org.apache.clerezza.rdf.core.Triple;
import org.apache.clerezza.rdf.core.TripleCollection;
import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.impl.AbstractMGraph;
import org.apache.clerezza.rdf.core.impl.AbstractTripleCollection;
import org.apache.clerezza.utils.IteratorMerger;
@@ -37,7 +38,7 @@ import org.apache.clerezza.utils.Iterato
*
* @author reto
*/
-public class EnrichmentTriples extends AbstractTripleCollection {
+public class EnrichmentTriples extends AbstractMGraph {
private TripleCollection base;
private Collection<Enricher> enrichers;