jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rve...@apache.org
Subject svn commit: r1439993 - in /jena/trunk/jena-arq/src: main/java/org/apache/jena/riot/system/ test/java/org/apache/jena/riot/system/
Date Tue, 29 Jan 2013 16:45:44 GMT
Author: rvesse
Date: Tue Jan 29 16:45:44 2013
New Revision: 1439993

URL: http://svn.apache.org/viewvc?rev=1439993&view=rev
Log:
Further refactoring around PrefixMap

Pull more common functionality up into PrefixMapBase, rename PrefixMap2 to PrefixMapExtended
and rewrite as a true wrapper class.

Add test classes to exercise PrefixMapExtended

Added:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapExtended.java
    jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended1.java
    jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended2.java
Removed:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMap2.java
Modified:
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapStd.java
    jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/Prologue.java
    jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java
    jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java?rev=1439993&r1=1439992&r2=1439993&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java
(original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/FastAbbreviatingPrefixMap.java
Tue Jan 29 16:45:44 2013
@@ -22,14 +22,9 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.jena.atlas.iterator.Iter;
-import org.apache.jena.atlas.lib.ActionKeyValue;
 import org.apache.jena.atlas.lib.Pair;
 import org.apache.jena.atlas.lib.Trie;
 import org.apache.jena.iri.IRI;
-import org.apache.jena.iri.IRIFactory;
-
-import com.hp.hpl.jena.shared.PrefixMapping;
 
 /**
  * A prefix map implementation suited to output heavy workloads
@@ -85,30 +80,6 @@ public class FastAbbreviatingPrefixMap e
     }
 
     @Override
-    public Map<String, IRI> getMappingCopy() {
-        return new HashMap<String, IRI>(this.prefixes);
-    }
-
-    @Override
-    public Map<String, String> getMappingCopyStr() {
-        final Map<String, String> smap = new HashMap<String, String>();
-        ActionKeyValue<String, IRI> action = new ActionKeyValue<String, IRI>()
{
-            @Override
-            public void apply(String key, IRI value) {
-                String str = value.toString();
-                smap.put(key, str);
-            }
-        };
-        Iter.apply(getMapping(), action);
-        return smap;
-    }
-
-    @Override
-    public void add(String prefix, String iriString) {
-        this.add(prefix, IRIFactory.iriImplementation().create(iriString));
-    }
-
-    @Override
     public void add(String prefix, IRI iri) {
         prefix = canonicalPrefix(prefix);
 
@@ -133,22 +104,6 @@ public class FastAbbreviatingPrefixMap e
     }
 
     @Override
-    public void putAll(PrefixMap pmap) {
-        Map<String, IRI> map = pmap.getMapping();
-        for (String prefix : map.keySet()) {
-            this.add(prefix, map.get(prefix));
-        }
-    }
-
-    @Override
-    public void putAll(PrefixMapping pmap) {
-        Map<String, String> map = pmap.getNsPrefixMap();
-        for (String prefix : map.keySet()) {
-            this.add(prefix, map.get(prefix));
-        }
-    }
-
-    @Override
     public void delete(String prefix) {
         prefix = canonicalPrefix(prefix);
 

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java?rev=1439993&r1=1439992&r2=1439993&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapBase.java Tue Jan
29 16:45:44 2013
@@ -18,11 +18,17 @@
 
 package org.apache.jena.riot.system;
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
+import org.apache.jena.atlas.iterator.Iter;
+import org.apache.jena.atlas.lib.ActionKeyValue;
 import org.apache.jena.atlas.lib.Pair;
 import org.apache.jena.iri.IRI;
+import org.apache.jena.iri.IRIFactory;
+
+import com.hp.hpl.jena.shared.PrefixMapping;
 
 /**
  * Abstract base implementation of a {@link PrefixMap} which provides
@@ -40,6 +46,44 @@ public abstract class PrefixMapBase impl
             return prefix.substring(0, prefix.length() - 1);
         return prefix;
     }
+    
+    @Override
+    public Map<String, IRI> getMappingCopy() {
+        return new HashMap<String, IRI>(this.getMapping());
+    }
+    
+    @Override
+    public Map<String, String> getMappingCopyStr() {
+        final Map<String, String> smap = new HashMap<String, String>();
+        ActionKeyValue<String, IRI> action = new ActionKeyValue<String, IRI>()
{
+            @Override
+            public void apply(String key, IRI value) {
+                String str = value.toString();
+                smap.put(key, str);
+            }
+        };
+        Iter.apply(getMapping(), action);
+        return smap;
+    }
+    
+    @Override
+    public void add(String prefix, String iriString) {
+        this.add(prefix, IRIFactory.iriImplementation().create(iriString));
+    }
+    
+    @Override
+    public void putAll(PrefixMap pmap) {
+        for (Map.Entry<String, IRI> e : this.getMapping().entrySet()) {
+            this.add(e.getKey(), e.getValue());
+        }
+    }
+
+    @Override
+    public void putAll(PrefixMapping pmap) {
+        for (Map.Entry<String, String> e : pmap.getNsPrefixMap().entrySet()) {
+            this.add(e.getKey(), e.getValue());
+        }
+    }
 
     /**
      * Abbreviate an IRI or return a pair of prefix and local parts.
@@ -62,6 +106,14 @@ public abstract class PrefixMapBase impl
         return null;
     }
     
+    @Override
+    public String expand(String prefixedName) {
+        int i = prefixedName.indexOf(':');
+        if (i < 0)
+            return null;
+        return expand(prefixedName.substring(0, i), prefixedName.substring(i + 1));
+    }
+    
     /**
      * Is a local name safe for Turtle
      * @param ln Local name
@@ -70,4 +122,25 @@ public abstract class PrefixMapBase impl
     protected final boolean isTurtleSafe(String ln) {
         return (strSafeFor(ln, '/') && strSafeFor(ln, '#') && strSafeFor(ln,
':'));
     }
+    
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("{ ");
+        boolean first = true;
+
+        for (Entry<String, IRI> e : this.getMapping().entrySet()) {
+            String prefix = e.getKey();
+            IRI iri = e.getValue();
+            if (first)
+                first = false;
+            else
+                sb.append(" ,");
+            sb.append(prefix);
+            sb.append(":=");
+            sb.append(iri.toString());
+        }
+        sb.append(" }");
+        return sb.toString();
+    }
 }
\ No newline at end of file

Added: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapExtended.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapExtended.java?rev=1439993&view=auto
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapExtended.java (added)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapExtended.java Tue
Jan 29 16:45:44 2013
@@ -0,0 +1,109 @@
+/*
+ * 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.jena.riot.system;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.jena.atlas.lib.Pair;
+import org.apache.jena.atlas.logging.Log;
+import org.apache.jena.iri.IRI;
+
+// UNUSED
+/**
+ * Implementation of a {@link PrefixMap} which extends another prefix map
+ * without ever altering the parent.
+ * <p>
+ * This allows code to modify a prefix map based off of another map without
+ * modifying that original map. This is somewhat different than simply making a
+ * copy of an existing map since this implementation is partly a view over
+ * another map so will reflect changes that happen to the other map.
+ * </p>
+ */
+public class PrefixMapExtended extends PrefixMapBase {
+    PrefixMap parent;
+    PrefixMap local;
+
+    /**
+     * Creates an extended prefix map
+     * 
+     * @param ext
+     *            Prefix Map to extend
+     */
+    public PrefixMapExtended(PrefixMap ext) {
+        if (ext == null)
+            throw new IllegalArgumentException("Prefix Map to extend cannot be null");
+        this.parent = ext;
+        this.local = new PrefixMapStd();
+    }
+
+    @Override
+    public void add(String prefix, IRI iri) {
+        prefix = canonicalPrefix(prefix);
+        // Add to local always.
+        local.add(prefix, iri);
+    }
+
+    @Override
+    public void delete(String prefix) {
+        prefix = canonicalPrefix(prefix);
+        local.delete(prefix);
+        if (parent.contains(prefix))
+            Log.warn(this, "Attempt to delete a prefix in the parent");
+    }
+
+    @Override
+    public String expand(String prefix, String localName) {
+        prefix = canonicalPrefix(prefix);
+        String x = local.expand(prefix, localName);
+        if (x != null)
+            return x;
+        return parent.expand(prefix, localName);
+    }
+
+    @Override
+    public Map<String, IRI> getMapping() {
+        Map<String, IRI> mapping = new HashMap<String, IRI>();
+        mapping.putAll(parent.getMapping());
+        mapping.putAll(local.getMapping());
+        return Collections.unmodifiableMap(mapping);
+    }
+
+    @Override
+    public boolean contains(String prefix) {
+        return local.contains(prefix) || parent.contains(prefix);
+    }
+
+    @Override
+    public String abbreviate(String uriStr) {
+        String x = local.abbreviate(uriStr);
+        if (x != null)
+            return x;
+        return parent.abbreviate(uriStr);
+    }
+
+    @Override
+    public Pair<String, String> abbrev(String uriStr) {
+        Pair<String, String> p = local.abbrev(uriStr);
+        if (p != null)
+            return p;
+        return parent.abbrev(uriStr);
+    }
+}

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapStd.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapStd.java?rev=1439993&r1=1439992&r2=1439993&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapStd.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/PrefixMapStd.java Tue Jan
29 16:45:44 2013
@@ -21,14 +21,8 @@ package org.apache.jena.riot.system;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.jena.atlas.iterator.Iter;
-import org.apache.jena.atlas.lib.ActionKeyValue;
 import org.apache.jena.atlas.lib.Pair;
 import org.apache.jena.iri.IRI;
-import org.apache.jena.iri.IRIFactory;
-
 import com.hp.hpl.jena.shared.PrefixMapping;
 
 /**
@@ -68,134 +62,29 @@ public class PrefixMapStd extends Prefix
         prefixes.putAll(prefixMap.getMapping());
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jena.riot.system.LightweightPrefixMap#getMapping()
-     */
     @Override
     public Map<String, IRI> getMapping() {
         return prefixes2;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jena.riot.system.LightweightPrefixMap#getMappingCopy()
-     */
-    @Override
-    public Map<String, IRI> getMappingCopy() {
-        return new HashMap<String, IRI>(prefixes);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.jena.riot.system.LightweightPrefixMap#getMappingCopyStr()
-     */
-    @Override
-    public Map<String, String> getMappingCopyStr() {
-        final Map<String, String> smap = new HashMap<String, String>();
-        ActionKeyValue<String, IRI> action = new ActionKeyValue<String, IRI>()
{
-            @Override
-            public void apply(String key, IRI value) {
-                String str = value.toString();
-                smap.put(key, str);
-            }
-        };
-        Iter.apply(getMapping(), action);
-        return smap;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#add(java.lang.String,
-     * java.lang.String)
-     */
-    @Override
-    public void add(String prefix, String iriString) {
-        prefix = canonicalPrefix(prefix);
-        IRI iri = IRIFactory.iriImplementation().create(iriString);
-        // Check!
-        prefixes.put(prefix, iri);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#add(java.lang.String,
-     * org.apache.jena.iri.IRI)
-     */
     @Override
     public void add(String prefix, IRI iri) {
         prefix = canonicalPrefix(prefix);
         prefixes.put(prefix, iri);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#putAll(org.apache.jena
-     * .riot.system.PrefixMap)
-     */
-    @Override
-    public void putAll(PrefixMap pmap) {
-        prefixes.putAll(pmap.getMapping());
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#putAll(com.hp.hpl.jena
-     * .shared.PrefixMapping)
-     */
-    @Override
-    public void putAll(PrefixMapping pmap) {
-        for (Map.Entry<String, String> e : pmap.getNsPrefixMap().entrySet())
-            add(e.getKey(), e.getValue());
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#delete(java.lang.String)
-     */
     @Override
     public void delete(String prefix) {
         prefix = canonicalPrefix(prefix);
         prefixes.remove(prefix);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#contains(java.lang.String
-     * )
-     */
     @Override
     public boolean contains(String prefix) {
         prefix = canonicalPrefix(prefix);
-        return _contains(prefix);
-    }
-
-    protected boolean _contains(String prefix) {
         return prefixes.containsKey(prefix);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#abbreviate(java.lang
-     * .String)
-     */
     @Override
     public String abbreviate(String uriStr) {
         Pair<String, String> p = abbrev(this.prefixes, uriStr, true);
@@ -204,38 +93,11 @@ public class PrefixMapStd extends Prefix
         return p.getLeft() + ":" + p.getRight();
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#abbrev(java.lang.String)
-     */
     @Override
     public Pair<String, String> abbrev(String uriStr) {
         return abbrev(this.prefixes, uriStr, true);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#expand(java.lang.String)
-     */
-    @Override
-    public String expand(String prefixedName) {
-        int i = prefixedName.indexOf(':');
-        if (i < 0)
-            return null;
-        return expand(prefixedName.substring(0, i), prefixedName.substring(i + 1));
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see
-     * org.apache.jena.riot.system.LightweightPrefixMap#expand(java.lang.String,
-     * java.lang.String)
-     */
     @Override
     public String expand(String prefix, String localName) {
         prefix = canonicalPrefix(prefix);
@@ -244,25 +106,4 @@ public class PrefixMapStd extends Prefix
             return null;
         return x.toString() + localName;
     }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("{ ");
-        boolean first = true;
-
-        for (Entry<String, IRI> e : prefixes.entrySet()) {
-            String prefix = e.getKey();
-            IRI iri = e.getValue();
-            if (first)
-                first = false;
-            else
-                sb.append(" ,");
-            sb.append(prefix);
-            sb.append(":=");
-            sb.append(iri.toString());
-        }
-        sb.append(" }");
-        return sb.toString();
-    }
 }

Modified: jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/Prologue.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/Prologue.java?rev=1439993&r1=1439992&r2=1439993&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/Prologue.java (original)
+++ jena/trunk/jena-arq/src/main/java/org/apache/jena/riot/system/Prologue.java Tue Jan 29
16:45:44 2013
@@ -90,7 +90,7 @@ public class Prologue
         // New prefix mappings
         PrefixMap ext = getPrefixMap() ;
         if ( newMappings != null )
-            ext = new PrefixMap2(ext) ;
+            ext = new PrefixMapExtended(ext) ;
         // New base.
         IRIResolver r = resolver ;
         if ( base != null )

Modified: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java?rev=1439993&r1=1439992&r2=1439993&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java (original)
+++ jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TS_RiotSystem.java Tue Jan
29 16:45:44 2013
@@ -33,6 +33,8 @@ import org.junit.runners.Suite.SuiteClas
     // Prefix Map implementations
     , TestPrefixMap.class
     , TestFastAbbreviatingPrefixMap.class
+    , TestPrefixMapExtended1.class
+    , TestPrefixMapExtended2.class
     // May be subject to performance vagaries, with the improvements made
     // to the fast implementation this should be fairly safe
     , TestAbbreviationPerformance.class

Modified: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java?rev=1439993&r1=1439992&r2=1439993&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java
(original)
+++ jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestAbbreviationPerformance.java
Tue Jan 29 16:45:44 2013
@@ -44,8 +44,8 @@ public class TestAbbreviationPerformance
             fPerf += run(fast, input, expected, 1000);
         }
         
-        System.out.println("PrefixMap performance: " + nPerf + "ns");
-        System.out.println("Fast Prefix Map performance: " + fPerf + "ns");
+        //System.out.println("PrefixMap performance: " + nPerf + "ns");
+        //System.out.println("Fast Prefix Map performance: " + fPerf + "ns");
 
         if (fastShouldWin) {
             if (fPerf > nPerf)
@@ -106,11 +106,11 @@ public class TestAbbreviationPerformance
     @Test
     public void prefixMap_abbrev_performance_03() {
         PrefixMapStd pmap = new PrefixMapStd();
-        populate(pmap, 20);
+        populate(pmap, 40);
         FastAbbreviatingPrefixMap fmap = new FastAbbreviatingPrefixMap();
-        populate(fmap, 20);
+        populate(fmap, 40);
 
-        test_amalgamated_performance(pmap, fmap, 20, true);
+        test_amalgamated_performance(pmap, fmap, 40, true);
     }
     
     /**

Added: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended1.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended1.java?rev=1439993&view=auto
==============================================================================
--- jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended1.java
(added)
+++ jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended1.java
Tue Jan 29 16:45:44 2013
@@ -0,0 +1,32 @@
+/*
+ * 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.jena.riot.system;
+
+/**
+ * Tests for {@link PrefixMapExtended} applied over a {@link PrefixMapStd}
+ *
+ */
+public class TestPrefixMapExtended1 extends AbstractTestLightweightPrefixMap {
+
+    @Override
+    protected PrefixMap getPrefixMap() {
+        return new PrefixMapExtended(new PrefixMapStd());
+    }
+
+}

Added: jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended2.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended2.java?rev=1439993&view=auto
==============================================================================
--- jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended2.java
(added)
+++ jena/trunk/jena-arq/src/test/java/org/apache/jena/riot/system/TestPrefixMapExtended2.java
Tue Jan 29 16:45:44 2013
@@ -0,0 +1,32 @@
+/*
+ * 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.jena.riot.system;
+
+/**
+ * Tests for {@link PrefixMapExtended} applied over a {@link FastAbbreviatingPrefixMap}
+ *
+ */
+public class TestPrefixMapExtended2 extends AbstractTestLightweightPrefixMap {
+
+    @Override
+    protected PrefixMap getPrefixMap() {
+        return new PrefixMapExtended(new FastAbbreviatingPrefixMap());
+    }
+
+}



Mime
View raw message