[Mulgara-svn] r1618 - in branches/consistency/src/jar: query/java/org/mulgara/query/rdf resolver-prefix/java/org/mulgara/resolver/prefix

pag at mulgara.org pag at mulgara.org
Tue Mar 17 19:52:42 UTC 2009


Author: pag
Date: 2009-03-17 12:52:41 -0700 (Tue, 17 Mar 2009)
New Revision: 1618

Modified:
   branches/consistency/src/jar/query/java/org/mulgara/query/rdf/Mulgara.java
   branches/consistency/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/PrefixResolverFactory.java
Log:
Centralized strings from the Mulgara namespace

Modified: branches/consistency/src/jar/query/java/org/mulgara/query/rdf/Mulgara.java
===================================================================
--- branches/consistency/src/jar/query/java/org/mulgara/query/rdf/Mulgara.java	2009-03-17 19:51:26 UTC (rev 1617)
+++ branches/consistency/src/jar/query/java/org/mulgara/query/rdf/Mulgara.java	2009-03-17 19:52:41 UTC (rev 1618)
@@ -27,6 +27,8 @@
 
 package org.mulgara.query.rdf;
 
+import java.net.URI;
+
 /**
  * General constants.
  *
@@ -57,4 +59,14 @@
 
   /** An identifier for a XSD resolver graph */
   public final static String XSD_GRAPH = "sys:xsd";
+
+  /** The URI for prefix graph types. */
+  public final static URI PREFIX_GRAPH_TYPE_URI = URI.create(NAMESPACE + "PrefixGraph");
+
+  /** The URI for prefixes. */
+  public final static URI PREFIX_URI = URI.create(NAMESPACE + "prefix");
+
+  /** The URI for prefixes. */
+  public final static URI IS_URI = URI.create(NAMESPACE + "is");
+
 }

Modified: branches/consistency/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/PrefixResolverFactory.java
===================================================================
--- branches/consistency/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/PrefixResolverFactory.java	2009-03-17 19:51:26 UTC (rev 1617)
+++ branches/consistency/src/jar/resolver-prefix/java/org/mulgara/resolver/prefix/PrefixResolverFactory.java	2009-03-17 19:52:41 UTC (rev 1618)
@@ -38,15 +38,9 @@
   /** Logger. */
   private static Logger logger = Logger.getLogger(PrefixResolverFactory.class.getName());
 
-  /** The URI for the graphType.  */
-  private static final URI graphTypeURI = URI.create(Mulgara.NAMESPACE + "PrefixGraph");
-
   /** The URI for the default graph. */
   private static final URI DEFAULT_GRAPH = URI.create(Mulgara.PREFIX_GRAPH);
 
-  /** The URI for prefixes. */
-  private static final URI mulgaraPrefixURI = URI.create(Mulgara.NAMESPACE + "prefix");
-
   /** The preallocated local node representing the prefix predicate. */
   private long mulgaraPrefix;
 
@@ -66,7 +60,7 @@
     }
 
     // intialize the fields
-    mulgaraPrefix = initializer.preallocate(new URIReferenceImpl(mulgaraPrefixURI));
+    mulgaraPrefix = initializer.preallocate(new URIReferenceImpl(Mulgara.PREFIX_URI));
 
     // no need to claim the types supported by this resolver, as this is detected in the default graphs
   }
@@ -116,14 +110,14 @@
       boolean canWrite, ResolverSession resolverSession, Resolver systemResolver
   ) throws ResolverFactoryException {
     if (logger.isDebugEnabled()) logger.debug("Creating new Prefix resolver");
-    return new PrefixResolver(resolverSession, systemResolver, mulgaraPrefix, graphTypeURI);
+    return new PrefixResolver(resolverSession, systemResolver, mulgaraPrefix, Mulgara.PREFIX_GRAPH_TYPE_URI);
   }
 
   /**
    * @return The default graph for this resolver.
    */
   public Graph[] getDefaultGraphs() {
-    return new Graph[] { new Graph(DEFAULT_GRAPH, graphTypeURI) };
+    return new Graph[] { new Graph(DEFAULT_GRAPH, Mulgara.PREFIX_GRAPH_TYPE_URI) };
   }
   
   /**




More information about the Mulgara-svn mailing list