clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [04/14] clerezza git commit: CLEREZZA-966: moved rdf.utils into the hierarchy
Date Sun, 22 Mar 2015 22:04:47 GMT
http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/UriMutatingGraph.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/UriMutatingGraph.java b/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/UriMutatingGraph.java
deleted file mode 100644
index 4b0a4dc..0000000
--- a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/UriMutatingGraph.java
+++ /dev/null
@@ -1,223 +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.utils;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.concurrent.locks.ReadWriteLock;
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.apache.commons.rdf.RdfTerm;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.ImmutableGraph;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.AbstractGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import org.apache.commons.rdf.impl.utils.simple.SimpleImmutableGraph;
-
-/**
- * This wrapps a Triplecollection changing a prefix for the Iris contained
- * in subject or object position.
- *
- * Currently it only supports read opearations.
- *
- * @author reto
- */
-public class UriMutatingGraph implements Graph {
-
-    private final Graph base;
-    private final String sourcePrefix;
-    private final String targetPrefix;
-    private final int sourcePrefixLength;
-    private final int targetPrefixLength;
-
-    public UriMutatingGraph(Graph base, String sourcePrefix,
-            String targetPrefix) {
-        this.base = base;
-        this.sourcePrefix = sourcePrefix;
-        sourcePrefixLength= sourcePrefix.length();
-        this.targetPrefix = targetPrefix;
-        targetPrefixLength= targetPrefix.length();
-    }
-
-    private <R extends RdfTerm> R toTargetRdfTerm(final R sourceRdfTerm) {
-        if (sourceRdfTerm instanceof Iri) {
-            final Iri sourceIri = (Iri) sourceRdfTerm;
-            if (sourceIri.getUnicodeString().startsWith(sourcePrefix)) {
-                final String uriRest = sourceIri.getUnicodeString()
-                        .substring(sourcePrefixLength);
-                return (R) new Iri(targetPrefix+uriRest);
-            }
-        }
-        return sourceRdfTerm;            
-    }
-
-    private Triple toTargetTriple(Triple triple) {
-        if (triple == null) {
-            return null;
-        }
-        return new TripleImpl(toTargetRdfTerm(triple.getSubject()),
-                triple.getPredicate(), toTargetRdfTerm(triple.getObject()));
-    }
-
-    private <R extends RdfTerm> R toSourceRdfTerm(final R targetRdfTerm) {
-        if (targetRdfTerm instanceof Iri) {
-            final Iri sourceIri = (Iri) targetRdfTerm;
-            if (sourceIri.getUnicodeString().startsWith(targetPrefix)) {
-                final String uriRest = sourceIri.getUnicodeString()
-                        .substring(targetPrefixLength);
-                return (R) new Iri(sourcePrefix+uriRest);
-            }
-        }
-        return targetRdfTerm;
-    }
-
-    private Triple toSourceTriple(Triple triple) {
-        if (triple == null) {
-            return null;
-        }
-        return new TripleImpl(toSourceRdfTerm(triple.getSubject()),
-                triple.getPredicate(), toSourceRdfTerm(triple.getObject()));
-    }
-
-    @Override
-    public Iterator<Triple> filter(BlankNodeOrIri subject, Iri predicate, RdfTerm object) {
-        final Iterator<Triple> baseIter = base.filter(toSourceRdfTerm(subject),
-                predicate, toSourceRdfTerm(object));
-        return new WrappedIteraror(baseIter);
-
-
-    }
-
-
-    @Override
-    public int size() {
-        return base.size();
-    }
-
-    @Override
-    public boolean isEmpty() {
-        return base.isEmpty();
-    }
-
-    @Override
-    public boolean contains(Object o) {
-        return base.contains(toSourceTriple((Triple)o));
-    }
-
-    @Override
-    public Iterator<Triple> iterator() {
-        return filter(null, null, null);
-    }
-
-    @Override
-    public Object[] toArray() {
-        Object[] result = base.toArray();
-        for (int i = 0; i < result.length; i++) {
-            Triple triple = (Triple) result[i];
-            result[i] = toTargetTriple(triple);
-        }
-        return result;
-    }
-
-    @Override
-    public <T> T[] toArray(T[] a) {
-        T[] result = base.toArray(a);
-        for (int i = 0; i < result.length; i++) {
-            Triple triple = (Triple) result[i];
-            result[i] = (T) toTargetTriple(triple);
-        }
-        return result;
-    }
-
-    @Override
-    public boolean add(Triple e) {
-        throw new UnsupportedOperationException("Not supported.");
-    }
-
-    @Override
-    public boolean remove(Object o) {
-        throw new UnsupportedOperationException("Not supported.");
-    }
-
-    @Override
-    public boolean containsAll(Collection<?> c) {
-        for (Object object : c) {
-            if (!contains(object)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean addAll(Collection<? extends Triple> c) {
-        throw new UnsupportedOperationException("Not supported.");
-    }
-
-    @Override
-    public boolean removeAll(Collection<?> c) {
-        throw new UnsupportedOperationException("Not supported.");
-    }
-
-    @Override
-    public boolean retainAll(Collection<?> c) {
-        throw new UnsupportedOperationException("Not supported.");
-    }
-
-    @Override
-    public void clear() {
-        throw new UnsupportedOperationException("Not supported.");
-    }
-
-    @Override
-    public ImmutableGraph getImmutableGraph() {
-        return new SimpleImmutableGraph(this);
-    }
-
-    @Override
-    public ReadWriteLock getLock() {
-        return base.getLock();
-    }
-
-    class WrappedIteraror implements Iterator<Triple>{
-        private final Iterator<Triple> baseIter;
-
-        private WrappedIteraror(Iterator<Triple> baseIter) {
-            this.baseIter = baseIter;
-        }
-
-        @Override
-        public boolean hasNext() {
-            return baseIter.hasNext();
-        }
-
-        @Override
-        public Triple next() {
-            return toTargetTriple(baseIter.next());
-        }
-
-        @Override
-        public void remove() {
-            throw new UnsupportedOperationException("Not supported yet.");
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/graphnodeprovider/GraphNodeProvider.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/graphnodeprovider/GraphNodeProvider.java b/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/graphnodeprovider/GraphNodeProvider.java
deleted file mode 100644
index 03c73a5..0000000
--- a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/graphnodeprovider/GraphNodeProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.clerezza.rdf.utils.graphnodeprovider;
-
-/*
- * 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.clerezza.rdf.utils.GraphNode;
-
-/**
- * A service that returns a GraphNode for a specified named resource, the
- * returned GraphNode has as BaseGraph the ContentGraph provided by the
- * ContentGraphProvider and the for remote uris the Graphs they dereference to
- * and for local URIs with a path-section starting with /user/{username}/ the
- * local-public-graph of that user.
- */
-public interface GraphNodeProvider {
-
-    /**
-     * Get a GraphNode for the specified resource, see class comments for
-     * details.
-     */
-    GraphNode get(Iri uriRef);
-
-    /**
-     * Get a GraphNode for the specified resource, The resource is assumed to be
-     * local, i.e. the method behaves like get(Iri) for a Uri with an
-     * authority section contained in the Set retuned by
-     * <code>org.apache.clerezza.platform.config.PlatformConfig#getBaseUris()</code>
-     */
-    GraphNode getLocal(Iri uriRef);
-
-    /**
-     * return true iff getLocal(uriRef).getNodeContext.size > 0
-     */
-    boolean existsLocal(Iri uriRef);
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/BaseSmusher.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/BaseSmusher.java b/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/BaseSmusher.java
deleted file mode 100644
index 1841cd1..0000000
--- a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/BaseSmusher.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright 2013 The Apache Software Foundation.
- *
- * 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.
- */
-package org.apache.clerezza.rdf.utils.smushing;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.locks.Lock;
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.apache.commons.rdf.RdfTerm;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.OWL;
-
-/**
- *
- * @author Reto
- */
-public class BaseSmusher {
-
-    /**
-     * Smushes the resources in mGraph that belong to the same set in equivalenceSets,
-     * i.e. it adds all properties to one of the resources in the equivalence set.
-     * 
-     * Optionally owl:sameAs statement are added that point from the IRIs that 
-     * no longer have properties to the one with properties. If addOwlSameAs
-     * is false the IRIs will just disappear from the graph.
-     * 
-     * @param mGraph the graph to smush
-     * @param equivalenceSets sets of equivalent resources
-     * @param addOwlSameAs whether owl:sameAs statements should be added
-     */
-    public void smush(Graph mGraph, Set<Set<BlankNodeOrIri>> equivalenceSets, boolean addOwlSameAs) {
-        Map<BlankNodeOrIri, BlankNodeOrIri> current2ReplacementMap = new HashMap<BlankNodeOrIri, BlankNodeOrIri>();
-        final Graph owlSameAsGraph = new SimpleGraph();
-        for (Set<BlankNodeOrIri> equivalenceSet : equivalenceSets) {
-            final BlankNodeOrIri replacement = getReplacementFor(equivalenceSet, owlSameAsGraph);
-            for (BlankNodeOrIri current : equivalenceSet) {
-                if (!current.equals(replacement)) {
-                    current2ReplacementMap.put(current, replacement);
-                }
-            }
-        }
-        final Set<Triple> newTriples = new HashSet<Triple>();
-        Lock l = mGraph.getLock().writeLock();
-        l.lock();
-        try {
-            for (Iterator<Triple> it = mGraph.iterator(); it.hasNext();) {
-                final Triple triple = it.next();
-                final BlankNodeOrIri subject = triple.getSubject();
-                BlankNodeOrIri subjectReplacement = current2ReplacementMap.get(subject);
-                final RdfTerm object = triple.getObject();
-                @SuppressWarnings(value = "element-type-mismatch")
-                RdfTerm objectReplacement = current2ReplacementMap.get(object);
-                if ((subjectReplacement != null) || (objectReplacement != null)) {
-                    it.remove();
-                    if (subjectReplacement == null) {
-                        subjectReplacement = subject;
-                    }
-                    if (objectReplacement == null) {
-                        objectReplacement = object;
-                    }
-                    newTriples.add(new TripleImpl(subjectReplacement, triple.getPredicate(), objectReplacement));
-                }
-            }
-            for (Triple triple : newTriples) {
-                mGraph.add(triple);
-            }
-            mGraph.addAll(owlSameAsGraph);
-        } finally {
-            l.unlock();
-        }
-    }
-    
-    private BlankNodeOrIri getReplacementFor(Set<BlankNodeOrIri> equivalenceSet, 
-            Graph owlSameAsGraph) {
-        final Set<Iri> uriRefs = new HashSet<Iri>();
-        for (BlankNodeOrIri nonLiteral : equivalenceSet) {
-            if (nonLiteral instanceof Iri) {
-                uriRefs.add((Iri) nonLiteral);
-            }
-        }
-        switch (uriRefs.size()) {
-            case 1:
-                return uriRefs.iterator().next();
-            case 0:
-                return new BlankNode();
-        }
-        final Iri preferedIri = getPreferedIri(uriRefs);
-        final Iterator<Iri> uriRefIter = uriRefs.iterator();
-        while (uriRefIter.hasNext()) {
-            Iri uriRef = uriRefIter.next();
-            if (!uriRef.equals(preferedIri)) {
-                owlSameAsGraph.add(new TripleImpl(uriRef, OWL.sameAs, preferedIri));
-            }
-        }
-        return preferedIri;
-    }
-
-    
-    /**
-     * Returns a prefered IRI for the IRIs in a set. Typically and in the
-     * default implementation the IRI will be one of the set. Note however that 
-     * subclass implementations may also return another IRI to be used.
-     * 
-     * @param uriRefs
-     * @return 
-     */
-    protected Iri getPreferedIri(Set<Iri> uriRefs) {
-        final Iterator<Iri> uriRefIter = uriRefs.iterator();
-        //instead of an arbitrary one we might either decide lexicographically
-        //or look at their frequency in mGraph
-        return uriRefIter.next();
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/IfpSmusher.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/IfpSmusher.java b/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/IfpSmusher.java
deleted file mode 100644
index fad1d6b..0000000
--- a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/IfpSmusher.java
+++ /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.utils.smushing;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.apache.commons.rdf.RdfTerm;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-import org.apache.clerezza.rdf.ontologies.OWL;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A utility to equate duplicate nodes in an Mgarph, currently only nodes with 
- * a shared ifp are equated.
- *
- * @author reto
- */
-public class IfpSmusher extends BaseSmusher {
-    
-    static final Logger log = LoggerFactory.getLogger(IfpSmusher.class);
-
-    /**
-     * smush mGaph given the ontological facts. Currently it does only
-     * one step ifp smushin, i.e. only ifps are taken in account and only
-     * nodes that have the same node as ifp object in the orignal graph are
-     * equates. (calling the method a second time might lead to additional
-     * smushings.)
-     *
-     * @param mGraph
-     * @param tBox
-     */
-    public void smush(Graph mGraph, Graph tBox) {
-        final Set<Iri> ifps = getIfps(tBox);
-        final Map<PredicateObject, Set<BlankNodeOrIri>> ifp2nodesMap = new HashMap<PredicateObject, Set<BlankNodeOrIri>>();
-        for (Iterator<Triple> it = mGraph.iterator(); it.hasNext();) {
-            final Triple triple = it.next();
-            final Iri predicate = triple.getPredicate();
-            if (!ifps.contains(predicate)) {
-                continue;
-            }
-            final PredicateObject po = new PredicateObject(predicate, triple.getObject());
-            Set<BlankNodeOrIri> equivalentNodes = ifp2nodesMap.get(po);
-            if (equivalentNodes == null) {
-                equivalentNodes = new HashSet<BlankNodeOrIri>();
-                ifp2nodesMap.put(po, equivalentNodes);
-            }
-            equivalentNodes.add(triple.getSubject());
-        }
-        Set<Set<BlankNodeOrIri>> unitedEquivalenceSets = uniteSetsWithCommonElement(ifp2nodesMap.values());
-        smush(mGraph, unitedEquivalenceSets, true);
-    }
-    
-
-    private Set<Iri> getIfps(Graph tBox) {
-        final Iterator<Triple> ifpDefinitions = tBox.filter(null, RDF.type,
-                OWL.InverseFunctionalProperty);
-        final Set<Iri> ifps = new HashSet<Iri>();
-        while (ifpDefinitions.hasNext()) {
-            final Triple triple = ifpDefinitions.next();
-            ifps.add((Iri) triple.getSubject());
-        }
-        return ifps;
-    }
-
-    private <T> Set<Set<T>> uniteSetsWithCommonElement(
-            Collection<Set<T>> originalSets) {
-        Set<Set<T>> result = new HashSet<Set<T>>();
-        Iterator<Set<T>> iter = originalSets.iterator();
-        while (iter.hasNext()) {
-            Set<T> originalSet = iter.next();
-            //TODO this could be done more efficiently with a map
-            Set<T> matchingSet = getMatchinSet(originalSet, result);
-            if (matchingSet != null) {
-                matchingSet.addAll(originalSet);
-            } else {
-                result.add(new HashSet<T>(originalSet));
-            }
-        }
-        if (result.size() < originalSets.size()) {
-            return uniteSetsWithCommonElement(result);
-        } else {
-            return result;
-        }
-    }
-
-    private <T> Set<T> getMatchinSet(Set<T> set, Set<Set<T>> setOfSet) {
-        for (Set<T> current : setOfSet) {
-            if (shareElements(set,current)) {
-                return current;
-            }
-        }
-        return null;
-    }
-
-    private <T> boolean shareElements(Set<T> set1, Set<T> set2) {
-        for (T elem : set2) {
-            if (set1.contains(elem)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-
-    class PredicateObject {
-
-        final Iri predicate;
-        final RdfTerm object;
-
-        public PredicateObject(Iri predicate, RdfTerm object) {
-            this.predicate = predicate;
-            this.object = object;
-        }
-
-        @Override
-        public boolean equals(Object obj) {
-            if (obj == null) {
-                return false;
-            }
-            if (getClass() != obj.getClass()) {
-                return false;
-            }
-            final PredicateObject other = (PredicateObject) obj;
-            if (this.predicate != other.predicate && !this.predicate.equals(other.predicate)) {
-                return false;
-            }
-            if (this.object != other.object && !this.object.equals(other.object)) {
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public int hashCode() {
-            int hash = 3;
-            hash = 29 * hash + this.predicate.hashCode();
-            hash = 13 * hash + this.object.hashCode();
-            return hash;
-        }
-
-        @Override
-        public String toString() {
-            return "("+predicate+", "+object+")";
-        }
-
-
-    };
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/SameAsSmusher.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/SameAsSmusher.java b/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/SameAsSmusher.java
deleted file mode 100644
index e656a42..0000000
--- a/rdf.utils/src/main/java/org/apache/clerezza/rdf/utils/smushing/SameAsSmusher.java
+++ /dev/null
@@ -1,113 +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.utils.smushing;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.rdf.BlankNodeOrIri;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Iri;
-import org.apache.clerezza.rdf.ontologies.OWL;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A utility to equate duplicate nodes in an Mgraph. This unifies owl:sameAs
- * resources.
- *
- * @author reto
- */
-public class SameAsSmusher extends BaseSmusher {
-    
-    static final Logger log = LoggerFactory.getLogger(SameAsSmusher.class);
-    
-    /**
-     * This will ensure that all properties of sameAs resources are associated
-     * to the preferedIri as returned by {@code getPreferedIri}
-     * @param mGraph
-     * @param owlSameStatements 
-     * @param addCanonicalSameAsStatements if true owl:sameAsStatements with the preferedIri as object will be added
-     */
-    public void smush(Graph mGraph, 
-            Graph owlSameStatements,
-            boolean addCanonicalSameAsStatements) {
-    	
-    	log.info("Starting smushing");
-        
-    	// This hashmap contains a uri (key) and the set of equivalent uris (value)
-    	final Map<BlankNodeOrIri, Set<BlankNodeOrIri>> node2EquivalenceSet = new HashMap<BlankNodeOrIri, Set<BlankNodeOrIri>>();
-    	
-    	log.info("Creating the sets of equivalent uris of each subject or object in the owl:sameAs statements");
-    	// Determines for each subject and object in all the owl:sameAs statements the set of ewquivalent uris 
-    	for (Iterator<Triple> it = owlSameStatements.iterator(); it.hasNext();) {            
-    		final Triple triple = it.next();
-            final Iri predicate = triple.getPredicate();
-            if (!predicate.equals(OWL.sameAs)) {
-                throw new RuntimeException("Statements must use only <http://www.w3.org/2002/07/owl#sameAs> predicate.");
-            }
-            final BlankNodeOrIri subject = triple.getSubject();
-            //literals not yet supported
-            final BlankNodeOrIri object = (BlankNodeOrIri)triple.getObject();
-            
-            Set<BlankNodeOrIri> equivalentNodes = node2EquivalenceSet.get(subject);
-            
-            // if there is not a set of equivalent uris then create a new set
-            if (equivalentNodes == null) {
-            	equivalentNodes = node2EquivalenceSet.get(object);
-            	if (equivalentNodes == null) {
-                    equivalentNodes = new HashSet<BlankNodeOrIri>();
-                }
-            } else {
-                Set<BlankNodeOrIri> objectSet = node2EquivalenceSet.get(object);
-                if ((objectSet != null) && (objectSet != equivalentNodes)) {
-                    //merge two sets
-                    for (BlankNodeOrIri res : objectSet) {
-                        node2EquivalenceSet.remove(res);
-                    }
-                    for (BlankNodeOrIri res : objectSet) {
-                        node2EquivalenceSet.put(res,equivalentNodes);
-                    }
-                    equivalentNodes.addAll(objectSet);
-                }
-            }
-            
-            // add both subject and object of the owl:sameAs statement to the set of equivalent uris
-            equivalentNodes.add(subject);
-            equivalentNodes.add(object);
-            
-            // use both uris in the owl:sameAs statement as keys for the set of equivalent uris
-            node2EquivalenceSet.put(subject, equivalentNodes);
-            node2EquivalenceSet.put(object, equivalentNodes);
-            
-            log.info("Sets of equivalent uris created.");
-        
-    	}
-    	
-    	// This set contains the sets of equivalent uris
-    	Set<Set<BlankNodeOrIri>> unitedEquivalenceSets = new HashSet<Set<BlankNodeOrIri>>(node2EquivalenceSet.values());
-        smush(mGraph, unitedEquivalenceSets, addCanonicalSameAsStatements);
-    }
-
-    
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/GraphUtilsTest.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/GraphUtilsTest.java b/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/GraphUtilsTest.java
deleted file mode 100644
index fa14977..0000000
--- a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/GraphUtilsTest.java
+++ /dev/null
@@ -1,104 +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.utils;
-
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import org.apache.clerezza.rdf.utils.GraphUtils.NoSuchSubGraphException;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- *
- * @author reto
- */
-public class GraphUtilsTest {
-
-    final Iri u1 = new Iri("http://ex.org/1");
-    final Iri u2 = new Iri("http://ex.org/2");
-    final Iri u3 = new Iri("http://ex.org/3");
-
-    @Test
-    public void removeSubGraph() throws NoSuchSubGraphException {
-        Graph baseGraph = createBaseGraph();
-
-        Graph subGraph = new SimpleGraph();
-        {
-            BlankNode bNode1 = new BlankNode();
-            BlankNode bNode2 = new BlankNode();
-            subGraph.add(new TripleImpl(u1, u2, bNode2));
-            subGraph.add(new TripleImpl(bNode2, u2, bNode2));
-            subGraph.add(new TripleImpl(bNode2, u2, bNode1));
-        }
-        GraphUtils.removeSubGraph(baseGraph, subGraph);
-        Assert.assertEquals(1, baseGraph.size());
-    }
-
-    private Graph createBaseGraph() {
-        Graph baseGraph = new SimpleGraph();
-        {
-            BlankNode bNode1 = new BlankNode();
-            BlankNode bNode2 = new BlankNode();
-            baseGraph.add(new TripleImpl(u1, u2, bNode2));
-            baseGraph.add(new TripleImpl(bNode2, u2, bNode2));
-            baseGraph.add(new TripleImpl(bNode2, u2, bNode1));
-            baseGraph.add(new TripleImpl(u3, u2, u1));
-        }
-        return baseGraph;
-    }
-    
-    /** It is required that the subgraph comprises the whole context of the Bnodes it ioncludes
-     * 
-     * @throws org.apache.clerezza.rdf.utils.GraphUtils.NoSuchSubGraphException
-     */
-    @Test(expected=NoSuchSubGraphException.class)
-    public void removeIncompleteSubGraph() throws NoSuchSubGraphException {
-        Graph baseGraph = createBaseGraph();
-
-        Graph subGraph = new SimpleGraph();
-        {
-            BlankNode bNode1 = new BlankNode();
-            BlankNode bNode2 = new BlankNode();
-            subGraph.add(new TripleImpl(u1, u2, bNode2));
-            subGraph.add(new TripleImpl(bNode2, u2, bNode2));
-        }
-        GraphUtils.removeSubGraph(baseGraph, subGraph);
-    }
-
-    @Test(expected=NoSuchSubGraphException.class)
-    public void removeInvalidSubGraph() throws NoSuchSubGraphException {
-        Graph baseGraph = createBaseGraph();
-
-        Graph subGraph = new SimpleGraph();
-        {
-            BlankNode bNode1 = new BlankNode();
-            BlankNode bNode2 = new BlankNode();
-            subGraph.add(new TripleImpl(u1, u2, bNode2));
-            subGraph.add(new TripleImpl(bNode2, u2, bNode2));
-            baseGraph.add(new TripleImpl(bNode2, u2, bNode1));
-            baseGraph.add(new TripleImpl(bNode2, u2, new BlankNode()));
-        }
-        GraphUtils.removeSubGraph(baseGraph, subGraph);
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/IfpSmushTest.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/IfpSmushTest.java b/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/IfpSmushTest.java
deleted file mode 100644
index d7a2b81..0000000
--- a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/IfpSmushTest.java
+++ /dev/null
@@ -1,115 +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.utils;
-
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.FOAF;
-import org.apache.clerezza.rdf.ontologies.OWL;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- *
- * @author reto
- */
-public class IfpSmushTest {
-
-    private Graph ontology = new SimpleGraph();
-    {
-        ontology.add(new TripleImpl(FOAF.mbox, RDF.type, OWL.InverseFunctionalProperty));
-    }
-
-    @Test
-    public void simpleBlankNode()  {
-        Graph mGraph = new SimpleGraph();
-        Iri mbox1 = new Iri("mailto:foo@example.org");
-        final BlankNode bNode1 = new BlankNode();
-        mGraph.add(new TripleImpl(bNode1, FOAF.mbox, mbox1));
-        mGraph.add(new TripleImpl(bNode1, RDFS.comment, 
-                new PlainLiteralImpl("a comment")));
-        final BlankNode bNode2 = new BlankNode();
-        mGraph.add(new TripleImpl(bNode2, FOAF.mbox, mbox1));
-        mGraph.add(new TripleImpl(bNode2, RDFS.comment, 
-                new PlainLiteralImpl("another comment")));
-        Smusher.smush(mGraph, ontology);
-        Assert.assertEquals(3, mGraph.size());
-    }
-
-    @Test
-    public void overlappingEquivalenceClasses()  {
-        Graph mGraph = new SimpleGraph();
-        Iri mbox1 = new Iri("mailto:foo@example.org");
-        final BlankNode bNode1 = new BlankNode();
-        mGraph.add(new TripleImpl(bNode1, FOAF.mbox, mbox1));
-        mGraph.add(new TripleImpl(bNode1, RDFS.comment,
-                new PlainLiteralImpl("a comment")));
-        final BlankNode bNode2 = new BlankNode();
-        Iri mbox2 = new Iri("mailto:bar@example.org");
-        mGraph.add(new TripleImpl(bNode2, FOAF.mbox, mbox1));
-        mGraph.add(new TripleImpl(bNode2, FOAF.mbox, mbox2));
-        mGraph.add(new TripleImpl(bNode2, RDFS.comment,
-                new PlainLiteralImpl("another comment")));
-        final BlankNode bNode3 = new BlankNode();
-        mGraph.add(new TripleImpl(bNode3, FOAF.mbox, mbox2));
-        mGraph.add(new TripleImpl(bNode3, RDFS.comment,
-                new PlainLiteralImpl("yet another comment")));
-        Smusher.smush(mGraph, ontology);
-        Assert.assertEquals(5, mGraph.size());
-    }
-
-    @Test
-    public void oneIri()  {
-        Graph mGraph = new SimpleGraph();
-        Iri mbox1 = new Iri("mailto:foo@example.org");
-        final Iri resource = new Iri("http://example.org/");
-        mGraph.add(new TripleImpl(resource, FOAF.mbox, mbox1));
-        mGraph.add(new TripleImpl(resource, RDFS.comment,
-                new PlainLiteralImpl("a comment")));
-        final BlankNode bNode2 = new BlankNode();
-        mGraph.add(new TripleImpl(bNode2, FOAF.mbox, mbox1));
-        mGraph.add(new TripleImpl(bNode2, RDFS.comment,
-                new PlainLiteralImpl("another comment")));
-        Smusher.smush(mGraph, ontology);
-        Assert.assertEquals(3, mGraph.size());
-    }
-
-    @Test
-    public void twoIris()  {
-        Graph mGraph = new SimpleGraph();
-        Iri mbox1 = new Iri("mailto:foo@example.org");
-        final Iri resource1 = new Iri("http://example.org/");
-        mGraph.add(new TripleImpl(resource1, FOAF.mbox, mbox1));
-        mGraph.add(new TripleImpl(resource1, RDFS.comment,
-                new PlainLiteralImpl("a comment")));
-        final Iri resource2 = new Iri("http://2.example.org/");
-        mGraph.add(new TripleImpl(resource2, FOAF.mbox, mbox1));
-        mGraph.add(new TripleImpl(resource2, RDFS.comment,
-                new PlainLiteralImpl("another comment")));
-        Smusher.smush(mGraph, ontology);
-        Assert.assertEquals(4, mGraph.size());
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/RdfListTest.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/RdfListTest.java b/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/RdfListTest.java
deleted file mode 100644
index cd4045d..0000000
--- a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/RdfListTest.java
+++ /dev/null
@@ -1,183 +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.utils;
-
-import java.util.List;
-import java.util.Set;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.RdfTerm;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
-import static org.junit.Assert.*;
-
-/**
- *
- * @author rbn
- */
-public class RdfListTest {
-
-    @Test
-    public void listCreationAndAccess() {
-        Graph tc = new SimpleGraph();
-        List<RdfTerm> list = new RdfList(new Iri("http://example.org/mytest"), tc);
-        assertEquals(0, list.size());
-        list.add(new PlainLiteralImpl("hello"));
-        list.add(new PlainLiteralImpl("world"));
-        assertEquals(new PlainLiteralImpl("hello"), list.get(0));
-        assertEquals(new PlainLiteralImpl("world"), list.get(1));
-        assertEquals(2, list.size());
-        list.add(new PlainLiteralImpl("welcome"));
-        assertEquals(3, list.size());
-        assertEquals(new PlainLiteralImpl("welcome"), list.get(2));
-        list.add(1, new PlainLiteralImpl("interesting"));
-        assertEquals(4, list.size());
-        assertEquals(new PlainLiteralImpl("interesting"), list.get(1));
-        assertEquals(new PlainLiteralImpl("world"), list.get(2));
-        assertEquals(new PlainLiteralImpl("welcome"), list.get(3));
-        list.add(0, new PlainLiteralImpl("start"));
-        assertEquals(5, list.size());
-        assertEquals(new PlainLiteralImpl("hello"), list.get(1));
-        assertEquals(new PlainLiteralImpl("interesting"), list.get(2));
-        List<RdfTerm> list2 = new RdfList(new Iri("http://example.org/mytest"), tc);
-        assertEquals(5, list2.size());
-        assertEquals(new PlainLiteralImpl("hello"), list2.get(1));
-        assertEquals(new PlainLiteralImpl("interesting"), list2.get(2));
-        list2.remove(2);
-        assertEquals(4, list2.size());
-        assertEquals(new PlainLiteralImpl("hello"), list2.get(1));
-        assertEquals(new PlainLiteralImpl("world"), list2.get(2));
-        while (list2.size() > 0) {
-            list2.remove(0);
-        }
-        assertEquals(1, tc.size()); //list = rdf:nil statement
-        list2.add(0, new PlainLiteralImpl("restart"));
-        list2.add(1, new PlainLiteralImpl("over"));
-        assertEquals(2, list2.size());
-        list2.add(new PlainLiteralImpl("2"));
-        list2.add(new PlainLiteralImpl("3"));
-        assertEquals(4, list2.size());
-        list2.add(new PlainLiteralImpl("4"));
-        list2.add(new PlainLiteralImpl("5"));
-        assertEquals(new PlainLiteralImpl("3"), list2.get(3));
-    }
-
-    @Test
-    public void listCreationAndAccess2() {
-        Graph tc = new SimpleGraph();
-        List<RdfTerm> list = new RdfList(new Iri("http://example.org/mytest"), tc);
-        assertEquals(0, list.size());
-        list.add(0,new PlainLiteralImpl("world"));
-        list = new RdfList(new Iri("http://example.org/mytest"), tc);
-        list.add(0,new PlainLiteralImpl("beautifuly"));
-        list = new RdfList(new Iri("http://example.org/mytest"), tc);
-        list.add(0,new PlainLiteralImpl("hello"));
-        assertEquals(new PlainLiteralImpl("hello"), list.get(0));
-        assertEquals(new PlainLiteralImpl("beautifuly"), list.get(1));
-        assertEquals(new PlainLiteralImpl("world"), list.get(2));
-    }
-
-    @Test
-    public void listCreationAndAccess3() {
-        Graph tc = new SimpleGraph();
-        List<RdfTerm> list = new RdfList(new Iri("http://example.org/mytest"), tc);
-        assertEquals(0, list.size());
-        BlankNode node0 = new BlankNode() {};
-        BlankNode node1 = new BlankNode() {};
-        BlankNode node2 = new BlankNode() {};
-        list.add(0,node2);
-        list.add(0,node1);
-        list.add(0,node0);
-        assertEquals(node0, list.get(0));
-        assertEquals(node1, list.get(1));
-        assertEquals(node2, list.get(2));
-    }
-
-    @Test
-    public void secondButLastElementAccessTest() {
-        Graph tc = new SimpleGraph();
-        List<RdfTerm> list = new RdfList(new Iri("http://example.org/mytest2"), tc);
-        list.add(new PlainLiteralImpl("hello"));
-        list.add(new PlainLiteralImpl("world"));
-        list.remove(1);
-        assertEquals(1, list.size());
-    }
-
-    @Test
-    public void cleanGraphAfterRemoval() {
-        Graph tc = new SimpleGraph();
-        List<RdfTerm> list = new RdfList(new Iri("http://example.org/mytest"), tc);
-        list.add(new PlainLiteralImpl("hello"));
-        list.add(new PlainLiteralImpl("world"));
-        list.remove(1);
-        Assert.assertEquals(2, tc.size());
-
-    }
-
-    @Test
-    public void findContainingListNodesAndfindContainingListsTest() {
-        Graph tc = new SimpleGraph();
-        GraphNode listA = new GraphNode(new Iri("http:///listA"), tc);
-        GraphNode listB = new GraphNode(new Iri("http:///listB"), tc);
-        BlankNode element1 = new BlankNode();
-        BlankNode element2 = new BlankNode();
-        BlankNode element3 = new BlankNode();
-        BlankNode element4 = new BlankNode();
-        BlankNode element5 = new BlankNode();
-
-        RdfList rdfListA = new RdfList(listA);
-        rdfListA.add(element1);
-        rdfListA.add(element2);
-        rdfListA.add(element3);
-        rdfListA.add(element4);
-
-        RdfList rdfListB = new RdfList(listB);
-        rdfListB.add(element2);
-        rdfListB.add(element4);
-        rdfListB.add(element5);
-
-        Set<GraphNode> containingListNodes = RdfList.findContainingListNodes(
-                new GraphNode(element3, tc));
-        Assert.assertEquals(1, containingListNodes.size());
-        Assert.assertTrue(containingListNodes.contains(listA));
-
-        Set<RdfList> containingLists = RdfList.findContainingLists(
-                new GraphNode(element3, tc));
-        Assert.assertEquals(1, containingLists.size());
-        Assert.assertTrue(containingLists.contains(rdfListA));
-
-        containingListNodes = RdfList.findContainingListNodes(
-                new GraphNode(element4, tc));
-        Assert.assertEquals(2, containingListNodes.size());
-        Assert.assertTrue(containingListNodes.contains(listA));
-        Assert.assertTrue(containingListNodes.contains(listB));
-
-        containingLists = RdfList.findContainingLists(
-                new GraphNode(element4, tc));
-        Assert.assertEquals(2, containingLists.size());
-        Assert.assertTrue(containingLists.contains(rdfListA));
-        Assert.assertTrue(containingLists.contains(rdfListB));
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/SameAsSmushTest.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/SameAsSmushTest.java b/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/SameAsSmushTest.java
deleted file mode 100644
index 66c4005..0000000
--- a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/SameAsSmushTest.java
+++ /dev/null
@@ -1,78 +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.utils;
-
-import java.util.Iterator;
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Literal;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.FOAF;
-import org.apache.clerezza.rdf.ontologies.OWL;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- *
- * @author reto
- */
-public class SameAsSmushTest {
-    
-    private final Iri uriA = new Iri("http://example.org/A");
-    private final Iri uriB = new Iri("http://example.org/B");
-    private final Literal lit = new PlainLiteralImpl("That's me (and you)");
-
-    private Graph sameAsStatements = new SimpleGraph();
-    {
-        sameAsStatements.add(new TripleImpl(uriA, OWL.sameAs, uriB));
-    }
-    
-    private Graph  dataGraph = new SimpleGraph();
-    {
-        dataGraph.add(new TripleImpl(uriA, FOAF.knows, uriB));
-        dataGraph.add(new TripleImpl(uriB, RDFS.label, lit));
-        dataGraph.add(new TripleImpl(uriA, RDFS.label, lit));
-    }
-
-    @Test
-    public void simple()  {
-        Assert.assertEquals(3, dataGraph.size());
-        Smusher.sameAsSmush(dataGraph, sameAsStatements);
-        Assert.assertEquals(3, dataGraph.size());
-        Assert.assertTrue(dataGraph.filter(null, OWL.sameAs, null).hasNext());
-        //exactly one statement with literal 
-        Iterator<Triple> litStmts = dataGraph.filter(null, null, lit);
-        Assert.assertTrue(litStmts.hasNext());
-        Triple litStmt = litStmts.next();
-        Assert.assertFalse(litStmts.hasNext());
-        Iterator<Triple> knowsStmts = dataGraph.filter(null, FOAF.knows, null);
-        Assert.assertTrue(knowsStmts.hasNext());
-        Triple knowStmt = knowsStmts.next();
-        Assert.assertEquals(knowStmt.getSubject(), knowStmt.getObject());
-        Assert.assertEquals(litStmt.getSubject(), knowStmt.getObject());
-        Assert.assertEquals(litStmt.getSubject(), dataGraph.filter(null, OWL.sameAs, null).next().getObject());
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/TestGraphNode.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/TestGraphNode.java b/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/TestGraphNode.java
deleted file mode 100644
index af8434a..0000000
--- a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/TestGraphNode.java
+++ /dev/null
@@ -1,271 +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.utils;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import junit.framework.Assert;
-import org.junit.Test;
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Literal;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.RdfTerm;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import org.apache.clerezza.rdf.core.test.RandomGraph;
-
-/**
- *
- * @author reto, mir
- */
-public class TestGraphNode {
-
-    @Test
-    public void nodeContext() {
-        Graph g = new SimpleGraph();
-        BlankNode bNode1 = new BlankNode() {};
-        BlankNode bNode2 = new BlankNode() {};
-        Iri property1 = new Iri("http://example.org/property1");
-        Iri property2 = new Iri("http://example.org/property2");
-        g.add(new TripleImpl(bNode1, property1, new PlainLiteralImpl("literal")));
-        g.add(new TripleImpl(bNode1, property2, property1));
-        g.add(new TripleImpl(bNode2, property2, bNode1));
-        g.add(new TripleImpl(property1, property1, bNode2));
-        g.add(new TripleImpl(property1, property1, new PlainLiteralImpl("bla bla")));
-        GraphNode n = new GraphNode(bNode1, g);
-        Assert.assertEquals(4, n.getNodeContext().size());
-        n.deleteNodeContext();
-        Assert.assertEquals(1, g.size());
-        Assert.assertFalse(n.getObjects(property2).hasNext());
-    }
-
-    @Test
-    public void addNode() {
-        Graph g = new SimpleGraph();
-        BlankNode bNode1 = new BlankNode() {};
-        BlankNode bNode2 = new BlankNode() {};
-        Iri property1 = new Iri("http://example.org/property1");
-        GraphNode n = new GraphNode(bNode1, g);
-        n.addProperty(property1, bNode2);
-        Assert.assertEquals(1, g.size());
-    }
-
-    @Test
-    public void testGetSubjectAndObjectNodes() {
-        RandomGraph graph = new RandomGraph(500, 20, new SimpleGraph());
-        for (int j = 0; j < 200; j++) {
-            Triple randomTriple = graph.getRandomTriple();
-            GraphNode node = new GraphNode(randomTriple.getSubject(), graph);
-            Iterator<Iri> properties = node.getProperties();
-            while (properties.hasNext()) {
-                Iri property = properties.next();
-                Set<RdfTerm> objects = createSet(node.getObjects(property));
-                Iterator<GraphNode> objectNodes = node.getObjectNodes(property);
-                while (objectNodes.hasNext()) {
-                    GraphNode graphNode = objectNodes.next();
-                    Assert.assertTrue(objects.contains(graphNode.getNode()));
-                }
-            }
-        }
-
-        for (int j = 0; j < 200; j++) {
-            Triple randomTriple = graph.getRandomTriple();
-            GraphNode node = new GraphNode(randomTriple.getObject(), graph);
-            Iterator<Iri> properties = node.getProperties();
-            while (properties.hasNext()) {
-                Iri property = properties.next();
-                Set<RdfTerm> subjects = createSet(node.getSubjects(property));
-                Iterator<GraphNode> subjectNodes = node.getSubjectNodes(property);
-                while (subjectNodes.hasNext()) {
-                    GraphNode graphNode = subjectNodes.next();
-                    Assert.assertTrue(subjects.contains(graphNode.getNode()));
-                }
-            }
-        }
-    }
-
-    @Test
-    public void getAvailableProperties(){
-        Graph g = new SimpleGraph();
-        BlankNode bNode1 = new BlankNode() {};
-        BlankNode bNode2 = new BlankNode() {};
-        Iri property1 = new Iri("http://example.org/property1");
-        Iri property2 = new Iri("http://example.org/property2");
-        Iri property3 = new Iri("http://example.org/property3");
-        Iri property4 = new Iri("http://example.org/property4");
-        ArrayList<Iri> props = new ArrayList<Iri>();
-        props.add(property1);
-        props.add(property2);
-        props.add(property3);
-        props.add(property4);
-        GraphNode n = new GraphNode(bNode1, g);
-        n.addProperty(property1, bNode2);
-        n.addProperty(property2, bNode2);
-        n.addProperty(property3, bNode2);
-        n.addProperty(property4, bNode2);
-        Iterator<Iri> properties = n.getProperties();
-        int i = 0;
-        while(properties.hasNext()){
-            i++;
-            Iri prop = properties.next();
-            Assert.assertTrue(props.contains(prop));
-            props.remove(prop);
-        }
-        Assert.assertEquals(i, 4);
-        Assert.assertEquals(props.size(), 0);
-
-    }
-
-    @Test
-    public void deleteAll() {
-        Graph g = new SimpleGraph();
-        BlankNode bNode1 = new BlankNode() {};
-        BlankNode bNode2 = new BlankNode() {};
-        Iri property1 = new Iri("http://example.org/property1");
-        Iri property2 = new Iri("http://example.org/property2");
-        //the two properties two be deleted
-        g.add(new TripleImpl(bNode1, property1, new PlainLiteralImpl("literal")));
-        g.add(new TripleImpl(bNode1, property1, new PlainLiteralImpl("bla bla")));
-        //this 3 properties should stay
-        g.add(new TripleImpl(bNode1, property2, property1));
-        g.add(new TripleImpl(property1, property1, new PlainLiteralImpl("bla bla")));
-        g.add(new TripleImpl(bNode2, property1, new PlainLiteralImpl("bla bla")));
-        GraphNode n = new GraphNode(bNode1, g);
-        n.deleteProperties(property1);
-        Assert.assertEquals(3, g.size());
-    }
-
-    @Test
-    public void deleteSingleProperty() {
-        Graph g = new SimpleGraph();
-        BlankNode bNode1 = new BlankNode() {};
-        BlankNode bNode2 = new BlankNode() {};
-        Iri property1 = new Iri("http://example.org/property1");
-        Iri property2 = new Iri("http://example.org/property2");
-        //the properties two be deleted
-        g.add(new TripleImpl(bNode1, property1, new PlainLiteralImpl("literal")));
-        //this 4 properties should stay
-        g.add(new TripleImpl(bNode1, property1, new PlainLiteralImpl("bla bla")));
-        g.add(new TripleImpl(bNode1, property2, property1));
-        g.add(new TripleImpl(property1, property1, new PlainLiteralImpl("bla bla")));
-        g.add(new TripleImpl(bNode2, property1, new PlainLiteralImpl("bla bla")));
-        GraphNode n = new GraphNode(bNode1, g);
-        n.deleteProperty(property1, new PlainLiteralImpl("literal"));
-        Assert.assertEquals(4, g.size());
-    }
-
-    @Test
-    public void replaceWith() {
-        Graph initialGraph = new SimpleGraph();
-        BlankNode bNode1 = new BlankNode();
-        BlankNode bNode2 = new BlankNode();
-        BlankNode newBnode = new BlankNode();
-        Iri property1 = new Iri("http://example.org/property1");
-        Iri property2 = new Iri("http://example.org/property2");
-        Iri newIri = new Iri("http://example.org/newName");
-        Literal literal1 = new PlainLiteralImpl("literal");
-        Literal literal2 = new PlainLiteralImpl("bla bla");
-
-        Triple triple1 = new TripleImpl(bNode1, property1, literal1);
-        Triple triple2 = new TripleImpl(bNode1, property2, property1);
-        Triple triple3 = new TripleImpl(bNode2, property2, bNode1);
-        Triple triple4 = new TripleImpl(property1, property1, bNode2);
-        Triple triple5 = new TripleImpl(property1, property1, literal2);
-        initialGraph.add(triple1);
-        initialGraph.add(triple2);
-        initialGraph.add(triple3);
-        initialGraph.add(triple4);
-        initialGraph.add(triple5);
-        GraphNode node = new GraphNode(property1,
-                new SimpleGraph(initialGraph.iterator()));
-
-        node.replaceWith(newIri, true);
-        Assert.assertEquals(5, node.getGraph().size());
-        Triple expectedTriple1 = new TripleImpl(bNode1, newIri, literal1);
-        Triple expectedTriple2 = new TripleImpl(bNode1, property2, newIri);
-        Triple expectedTriple3 = new TripleImpl(newIri, newIri, bNode2);
-        Triple expectedTriple4 = new TripleImpl(newIri, newIri, literal2);
-
-        Assert.assertTrue(node.getGraph().contains(expectedTriple1));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple2));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple3));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple4));
-
-        Assert.assertFalse(node.getGraph().contains(triple1));
-        Assert.assertFalse(node.getGraph().contains(triple2));
-        Assert.assertFalse(node.getGraph().contains(triple4));
-        Assert.assertFalse(node.getGraph().contains(triple5));
-
-        node = new GraphNode(property1, new SimpleGraph(initialGraph.iterator()));
-        node.replaceWith(newBnode);
-        Triple expectedTriple5 = new TripleImpl(bNode1, property2, newBnode);
-        Triple expectedTriple6 = new TripleImpl(newBnode, property1, bNode2);
-        Triple expectedTriple7 = new TripleImpl(newBnode, property1, literal2);
-
-        Assert.assertTrue(node.getGraph().contains(triple1));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple5));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple6));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple7));
-
-        node = new GraphNode(literal1, new SimpleGraph(initialGraph.iterator()));
-        node.replaceWith(newBnode);
-        Triple expectedTriple8 = new TripleImpl(bNode1, property1, newBnode);
-        Assert.assertTrue(node.getGraph().contains(expectedTriple8));
-
-        node = new GraphNode(property1, new SimpleGraph(initialGraph.iterator()));
-        node.replaceWith(newIri);
-        Triple expectedTriple9 = new TripleImpl(bNode1, property2, newIri);
-        Triple expectedTriple10 = new TripleImpl(newIri, property1, bNode2);
-        Triple expectedTriple11 = new TripleImpl(newIri, property1, literal2);
-        Assert.assertTrue(node.getGraph().contains(triple1));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple9));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple10));
-        Assert.assertTrue(node.getGraph().contains(expectedTriple11));
-    }
-
-    @Test
-    public void equality() {
-        Graph g = new SimpleGraph();
-        BlankNode bNode1 = new BlankNode() {};
-        BlankNode bNode2 = new BlankNode() {};
-        Iri property1 = new Iri("http://example.org/property1");
-        GraphNode n = new GraphNode(bNode1, g);
-        n.addProperty(property1, bNode2);
-        Assert.assertTrue(n.equals(new GraphNode(bNode1, g)));
-        Assert.assertFalse(n.equals(new GraphNode(bNode2, g)));
-        GraphNode n2 = null;
-        Assert.assertFalse(n.equals(n2));
-    }
-
-    private Set<RdfTerm> createSet(Iterator<? extends RdfTerm> resources) {
-        Set<RdfTerm> set = new HashSet<RdfTerm>();
-        while (resources.hasNext()) {
-            RdfTerm resource = resources.next();
-            set.add(resource);
-        }
-        return set;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/UnionGraphTest.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/UnionGraphTest.java b/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/UnionGraphTest.java
deleted file mode 100644
index 2881eb4..0000000
--- a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/UnionGraphTest.java
+++ /dev/null
@@ -1,78 +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.utils;
-
-import java.util.Iterator;
-import org.junit.Test;
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import org.junit.Assert;
-
-/**
- *
- * @author hasan
- */
-public class UnionGraphTest {
-
-    private final Iri uriRef1 =
-            new Iri("http://example.org/ontology#res1");
-    private final Iri uriRef2 =
-            new Iri("http://example.org/ontology#res2");
-    private final Iri uriRef3 =
-            new Iri("http://example.org/ontology#res3");
-    private final Iri uriRef4 =
-            new Iri("http://example.org/ontology#res4");
-
-    @Test
-    public void readAccess() {
-        Graph graph = new SimpleGraph();
-        Graph graph2 = new SimpleGraph();
-        BlankNode bnode = new BlankNode() {
-        };
-        graph.add(new TripleImpl(uriRef1, uriRef2, uriRef1));
-        graph2.add(new TripleImpl(bnode, uriRef1, uriRef3));
-        Graph unionGraph = new UnionGraph(graph, graph2);
-        Iterator<Triple> unionTriples = unionGraph.iterator();
-        Assert.assertTrue(unionTriples.hasNext());
-        unionTriples.next();
-        Assert.assertTrue(unionTriples.hasNext());
-        unionTriples.next();
-        Assert.assertFalse(unionTriples.hasNext());
-        Assert.assertEquals(2, unionGraph.size());
-    }
-    
-    @Test
-    public void writeAccess() {
-        Graph graph = new SimpleGraph();
-        Graph graph2 = new SimpleGraph();
-        BlankNode bnode = new BlankNode() {
-        };
-        graph2.add(new TripleImpl(bnode, uriRef1, uriRef3));
-        Graph unionGraph = new UnionGraph(graph, graph2);
-        Assert.assertEquals(1, unionGraph.size());
-        unionGraph.add(new TripleImpl(uriRef4, uriRef1, uriRef3));
-        Assert.assertEquals(1, graph.size());
-        Assert.assertEquals(2, unionGraph.size());
-        Assert.assertEquals(1, graph2.size());
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/smushing/SameAsSmushTest.java
----------------------------------------------------------------------
diff --git a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/smushing/SameAsSmushTest.java b/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/smushing/SameAsSmushTest.java
deleted file mode 100644
index bab58e9..0000000
--- a/rdf.utils/src/test/java/org/apache/clerezza/rdf/utils/smushing/SameAsSmushTest.java
+++ /dev/null
@@ -1,92 +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.utils.smushing;
-
-import java.util.Iterator;
-import java.util.Set;
-import org.apache.commons.rdf.BlankNode;
-import org.apache.commons.rdf.Literal;
-import org.apache.commons.rdf.Graph;
-import org.apache.commons.rdf.Triple;
-import org.apache.commons.rdf.Iri;
-import org.apache.commons.rdf.impl.utils.PlainLiteralImpl;
-import org.apache.commons.rdf.impl.utils.simple.SimpleGraph;
-import org.apache.commons.rdf.impl.utils.TripleImpl;
-import org.apache.clerezza.rdf.ontologies.FOAF;
-import org.apache.clerezza.rdf.ontologies.OWL;
-import org.apache.clerezza.rdf.ontologies.RDF;
-import org.apache.clerezza.rdf.ontologies.RDFS;
-import org.junit.Assert;
-import org.junit.Test;
-
-/**
- *
- * @author reto
- */
-public class SameAsSmushTest {
-    
-    private final Iri uriA = new Iri("http://example.org/A");
-    private final Iri uriB = new Iri("http://example.org/B");
-    private final Iri uriC = new Iri("http://example.org/C");
-    
-    private final Literal lit = new PlainLiteralImpl("That's me (and you)");
-
-    private Graph sameAsStatements = new SimpleGraph();
-    {
-        sameAsStatements.add(new TripleImpl(uriA, OWL.sameAs, uriB));
-    }
-    
-    private Graph  dataGraph = new SimpleGraph();
-    {
-        dataGraph.add(new TripleImpl(uriA, FOAF.knows, uriB));
-        dataGraph.add(new TripleImpl(uriB, RDFS.label, lit));
-        dataGraph.add(new TripleImpl(uriA, RDFS.label, lit));
-    }
-
-    @Test
-    public void simple()  {
-        SameAsSmusher smusher = new SameAsSmusher() {
-
-            @Override
-            protected Iri getPreferedIri(Set<Iri> uriRefs) {
-                if (!uriRefs.contains(uriA)) throw new RuntimeException("not the set we excpect");
-                if (!uriRefs.contains(uriB)) throw new RuntimeException("not the set we excpect");
-                return uriC;
-            }
-            
-        };
-        Assert.assertEquals(3, dataGraph.size());
-        smusher.smush(dataGraph, sameAsStatements, true);
-        Assert.assertEquals(4, dataGraph.size());
-        Assert.assertTrue(dataGraph.filter(null, OWL.sameAs, null).hasNext());
-        //exactly one statement with literal 
-        Iterator<Triple> litStmts = dataGraph.filter(null, null, lit);
-        Assert.assertTrue(litStmts.hasNext());
-        Triple litStmt = litStmts.next();
-        Assert.assertFalse(litStmts.hasNext());
-        Iterator<Triple> knowsStmts = dataGraph.filter(null, FOAF.knows, null);
-        Assert.assertTrue(knowsStmts.hasNext());
-        Triple knowStmt = knowsStmts.next();
-        Assert.assertEquals(knowStmt.getSubject(), knowStmt.getObject());
-        Assert.assertEquals(litStmt.getSubject(), knowStmt.getObject());
-        Assert.assertEquals(litStmt.getSubject(), dataGraph.filter(null, OWL.sameAs, null).next().getObject());
-        Assert.assertEquals(knowStmt.getSubject(), uriC);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf/pom.xml
----------------------------------------------------------------------
diff --git a/rdf/pom.xml b/rdf/pom.xml
index bd9f5e9..6ce2eff 100644
--- a/rdf/pom.xml
+++ b/rdf/pom.xml
@@ -45,13 +45,14 @@
     <modules>
         <module>core</module>
         <module>core.test</module>
-        <module>ontologies</module>
-        <module>schemagen/main</module>
-        <module>schemagen/maven-plugin</module>
         <module>jena</module>
         <module>metadata</module>
+        <module>schemagen/main</module>
+        <module>schemagen/maven-plugin</module>
+        <module>ontologies</module>
         <module>rdfa</module>
         <module>simple.storage</module>
+        <module>utils</module>
     </modules>
 
 </project>

http://git-wip-us.apache.org/repos/asf/clerezza/blob/74f5fdb3/rdf/utils/LICENSE
----------------------------------------------------------------------
diff --git a/rdf/utils/LICENSE b/rdf/utils/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/rdf/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/74f5fdb3/rdf/utils/pom.xml
----------------------------------------------------------------------
diff --git a/rdf/utils/pom.xml b/rdf/utils/pom.xml
new file mode 100644
index 0000000..0f6b648
--- /dev/null
+++ b/rdf/utils/pom.xml
@@ -0,0 +1,69 @@
+<?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.utils</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Clerezza - RDF - Utilities</name>
+    <description>Utility classed to deal with Clerezza Models</description>
+    <dependencies>
+        <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.commons-rdf</groupId>
+            <artifactId>commons-rdf-api</artifactId>
+            <version>0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza.commons-rdf</groupId>
+            <artifactId>commons-rdf-impl-utils</artifactId>
+            <version>0.1-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.ontologies</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>rdf.core.test</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file


Mime
View raw message