Index: php/trunk/classes/Core.php
===================================================================
--- php/trunk/classes/Core.php	(revision 73)
+++ php/trunk/classes/Core.php	(revision 74)
@@ -24,4 +24,5 @@
 
   private $usedLibrary = NULL;
+  private $aNamespace;
 
   // ---------------------------------------
@@ -31,4 +32,6 @@
     // determ ine library to use
     $this->usedLibrary = 'arc';
+    
+    $this->aNamespace = array();
 
   } // public function __construct
@@ -118,6 +121,144 @@
     }
     return $result;
+
   }
 
+  // ---------------------------------------
+
+  public function filterTriples( $aTriples,
+                                 $subject = NULL,
+                                 $predicate = NULL,
+                                 $object = NULL) {
+
+    $searchTriple = array ( 's' =>  $subject, 'p' =>  $predicate, 'o' =>  $object);
+
+    // resolve namespace prefixes
+    $uriSubject   = $this->resolve( $subject);
+    $uriPredicate = $this->resolve( $predicate);
+    $uriObject    = $this->resolve( $object);
+
+    // resolve method may return NULL, then use original value
+    $uriSubject   = ($uriSubject   === NULL) ? $subject   : $uriSubject;
+    $uriPredicate = ($uriPredicate === NULL) ? $predicate : $uriPredicate;
+    $uriObject    = ($uriObject    === NULL) ? $object    : $uriObject;
+
+    // filter all available triples
+    $aresult = array();
+    foreach ($aTriples as $aTriple) {
+
+      // must be triple
+      if ((isset( $aTriple[ 'type'])) &&
+          ($aTriple[ 'type'] != 'triple'))
+        continue;
+
+      // check subject and predicate match if given
+      if (($uriSubject != NULL)   && (strcmp( $uriSubject, $aTriple[ 's'])))
+        continue;
+
+      if (($uriPredicate != NULL) && (strcmp( $uriPredicate, $aTriple[ 'p'])))
+        continue;
+
+      // check object if given
+      if ($uriObject != NULL) {
+
+        // check object match
+        if (strcmp( $uriObject, $aTriple[ 'o']))
+          continue;
+
+      } //  if ($uriObject != NULL) {
+
+      // store in result array
+      $aresult[] = $aTriple;
+
+    } // foreach ($aTriples as $aTriple)
+
+    return $aresult;
+
+  } //  static function filterTriples
+  
+  // ---------------------------------------
+  
+  public function setMapping( $prefix, $uriNamespace) {
+
+    if ($prefix == '')
+      return false;
+
+    // add colon to prefix as internally req.
+    if (substr( $prefix, -1) != ':')
+      $prefix = "$prefix:";
+
+    if (isset( $this->aNamespace[ $prefix])) {
+      $oldUriNamespace = $this->aNamespace[ $prefix];
+      if ($oldUriNamespace == $uriNamespace)
+        $debugmessage = "Namespace mapping exists: @prefix $prefix <$uriNamespace> .";
+      else
+        $debugmessage = "Namespace mapping overwritten: @prefix $prefix <$uriNamespace> .\n" .
+                        "Old mapping was: @prefix $prefix <$oldUriNamespace>";
+    } else {
+      $debugmessage = "Namespace mapping added: @prefix $prefix <$uriNamespace> .";
+    }
+
+    // set URI
+    $this->aNamespace[ $prefix] = $uriNamespace;
+    return $debugmessage;
+
+  } // public function setMapping
+  
+  // ---------------------------------------
+
+  public function resolve( $curie) {
+
+    $replacecount = 1;
+    $uri = NULL;
+    if ($curie != NULL) {
+      if ($this->aNamespace != NULL) {
+        if ((strpos( $uri, ":/") !== false) ||
+            (strpos( $uri, "_:") === 0)) {
+          $uri = $curi;
+        } else {
+          // check for namespaces
+          foreach ($this->aNamespace as $prefix => $uriNamespace) {
+            // check for prefix match
+            $posPrefix = strpos( $curie, $prefix);
+            if ($posPrefix === 0) {
+              // replace prefix and bail out
+              $uri = str_replace( $prefix, $uriNamespace, $curie, $replacecount);
+              break;
+            }
+          } // foreach ($this->aNamespace
+        } // if ((strpos ...
+      } // if ($aNamespace != NULL) {
+    }  // if ($uri != NULL) {
+
+    return $uri;
+
+  } //  public function resolve
+
+  // ---------------------------------------
+
+  public function shrink( $uri) {
+
+    $replacecount = 1;
+    if ($uri != NULL) {
+      if ($this->aNamespace != NULL) {
+        if (strpos( $uri, ":/") !== false) {
+          foreach ($this->aNamespace as $prefix => $uriNamespace) {
+            // search namespace URI
+            $posNamespace = strpos( $uri, $uriNamespace);
+            if ($posNamespace === false)
+              continue;
+            // replace namespace URI and bail out
+            $uri = str_replace( $uriNamespace, $prefix, $uri, &$replacecount);
+            break;
+          } // foreach ($aNamespace
+        } // if (strpos( $uri, ":/") !== false)
+      } // if ($aNamespace != NULL) {
+    }  // if ($uri != NULL) {
+
+    return $uri;
+
+  }  //  public function shrink
+
+
 } // class Core
 
Index: php/trunk/classes/rdfa_Data.php
===================================================================
--- php/trunk/classes/rdfa_Data.php	(revision 73)
+++ php/trunk/classes/rdfa_Data.php	(revision 74)
@@ -64,6 +64,6 @@
 
   private $debugger;
+  private $core;
   private $aTriples;
-  private $aNamespace;
 
   // ---------------------------------------
@@ -77,8 +77,10 @@
     // setup debugger
     $this->debugger = \fDebug::getInstance();
+    
+    $this->core = new \rdfint_core\Core();
 
     // initialize some vars
     $this->aTriples = array();
-    $this->aNamespace = array();
+
 
   } // public function __construct
@@ -127,4 +129,18 @@
                                                  'o' => $object));
   }
+  
+  // --------------------------------------------------------
+
+  /**
+   *  Shrink URI to CURI, but return <URI> if mapping not successful.
+   */
+  private function _shrinkFormatted( $uri) {
+
+    $curie = $this->_shrink( $uri);
+    if ($curie == $uri)
+      $curie = "<$uri>";
+    return $curie;
+
+  }  // private function _shrinkFormatted
 
   // --------------------------------------------------------
@@ -139,45 +155,5 @@
                                    &$debugmessage_result) {
 
-    $searchTriple = array ( 's' =>  $subject, 'p' =>  $predicate, 'o' =>  $object);
-
-    // resolve namespace prefixes
-    $uriSubject   = $this->_resolve( $subject);
-    $uriPredicate = $this->_resolve( $predicate);
-    $uriObject    = $this->_resolve( $object);
-
-    // resolve method may return NULL, then use original value
-    $uriSubject   = ($uriSubject   === NULL) ? $subject   : $uriSubject;
-    $uriPredicate = ($uriPredicate === NULL) ? $predicate : $uriPredicate;
-    $uriObject    = ($uriObject    === NULL) ? $object    : $uriObject;
-
-    // filter all available triples
-    $aresult = array();
-    foreach ($this->aTriples as $aTriple) {
-
-      // must be triple
-      if ((isset( $aTriple[ 'type'])) &&
-          ($aTriple[ 'type'] != 'triple'))
-        continue;
-
-      // check subject and predicate match if given
-      if (($uriSubject != NULL)   && (strcmp( $uriSubject, $aTriple[ 's'])))
-        continue;
-
-      if (($uriPredicate != NULL) && (strcmp( $uriPredicate, $aTriple[ 'p'])))
-        continue;
-
-      // check object if given
-      if ($uriObject != NULL) {
-
-        // check object match
-        if (strcmp( $uriObject, $aTriple[ 'o']))
-          continue;
-
-      } //  if ($uriObject != NULL) {
-
-      // store in result array
-      $aresult[] = $aTriple;
-
-    } // foreach ($aTriples as $aTriple)
+    $aresult = $this->core->filterTriples( $this->aTriples, $subject, $predicate, $object);
 
     // show result in debugger
@@ -214,49 +190,5 @@
   } // private function _subjectExists
 
-  // --------------------------------------------------------
-
-  /**
-   * Add mapping to internal namespace list.
-   * This method is called internally, not producing debug output.
-   */
-  private function _addNamespaceMapping( $prefix, $uriNamespace) {
-
-    if ($prefix == '')
-      return false;
-
-    // add colon to prefix as internally req.
-    if (substr( $prefix, -1) != ':')
-      $prefix = "$prefix:";
-
-    if (isset( $this->aNamespace[ $prefix])) {
-      $oldUriNamespace = $this->aNamespace[ $prefix];
-      if ($oldUriNamespace == $uriNamespace)
-        $debugmessage = "Namespace mapping exists: @prefix $prefix <$uriNamespace> .";
-      else
-        $debugmessage = "Namespace mapping overwritten: @prefix $prefix <$uriNamespace> .\n" .
-                        "Old mapping was: @prefix $prefix <$oldUriNamespace>";
-    } else {
-      $debugmessage = "Namespace mapping added: @prefix $prefix <$uriNamespace> .";
-    }
-
-    // set URI
-    $this->aNamespace[ $prefix] = $uriNamespace;
-    return $debugmessage;
-
-  } // private function _addNamespaceMapping
-
-  // --------------------------------------------------------
-
-  /**
-   *  Shrink URI to CURI, but return <URI> if mapping not successful.
-   */
-  private function _shrinkFormatted( $uri) {
-
-    $curie = $this->_shrink( $uri);
-    if ($curie == $uri)
-      $curie = "<$uri>";
-    return $curie;
-
-  }  // private function _shrinkFormatted
+
 
   // --------------------------------------------------------
@@ -356,5 +288,5 @@
    */
   public function setMapping( $prefix, $uriNamespace) {
-    $debugmessage = $this->_addNamespaceMapping( $prefix, $uriNamespace);
+    $debugmessage = $this->core->setMapping( $prefix, $uriNamespace);
     if ($debugmessage != false)
       $this->debugger->sendMessage( $debugmessage,
@@ -378,27 +310,5 @@
   public function _resolve( $curie) {
 
-    $replacecount = 1;
-    $uri = NULL;
-    if ($curie != NULL) {
-      if ($this->aNamespace != NULL) {
-        if ((strpos( $uri, ":/") !== false) ||
-            (strpos( $uri, "_:") === 0)) {
-          $uri = $curi;
-        } else {
-          // check for namespaces
-          foreach ($this->aNamespace as $prefix => $uriNamespace) {
-            // check for prefix match
-            $posPrefix = strpos( $curie, $prefix);
-            if ($posPrefix === 0) {
-              // replace prefix and bail out
-              $uri = str_replace( $prefix, $uriNamespace, $curie, $replacecount);
-              break;
-            }
-          } // foreach ($this->aNamespace
-        } // if ((strpos ...
-      } // if ($aNamespace != NULL) {
-    }  // if ($uri != NULL) {
-
-    return $uri;
+    return $this->core->resolve( $curie);
 
   } //  public function _resolve
@@ -417,23 +327,6 @@
    */
   public function _shrink( $uri) {
-
-    $replacecount = 1;
-    if ($uri != NULL) {
-      if ($this->aNamespace != NULL) {
-        if (strpos( $uri, ":/") !== false) {
-          foreach ($this->aNamespace as $prefix => $uriNamespace) {
-            // search namespace URI
-            $posNamespace = strpos( $uri, $uriNamespace);
-            if ($posNamespace === false)
-              continue;
-            // replace namespace URI and bail out
-            $uri = str_replace( $uriNamespace, $prefix, $uri, &$replacecount);
-            break;
-          } // foreach ($aNamespace
-        } // if (strpos( $uri, ":/") !== false)
-      } // if ($aNamespace != NULL) {
-    }  // if ($uri != NULL) {
-
-    return $uri;
+    
+    return $this->core->shrink( $uri);
 
   }  //  public function _shrink
@@ -1077,5 +970,5 @@
   public function _serialize( $type ) {
   
-    $core = new \rdfint_core\Core();    
+    $core = new \rdfint_core\Core();
     return $core->serialize( $this->aTriples, $type);
 
