Esempio n. 1
0
 /**
  * Return a human-readable (sort of) string "graphname { s p o . }"
  * describing the quad.
  *
  * @return string
  */
 function toString()
 {
     return 'GraphName(' . $this->graphName->getLabel() . ') ' . $this->statement->toString();
 }
Esempio n. 2
0
                var_dump($_REQUEST["otripleObject"]);
                print "-->";
                $os = new Statement($s, $p, $o);
                $m->remove($os);
                $s = new Resource($_REQUEST["tripleSubject"]);
                $p = new Resource($_REQUEST["triplePredicate"]);
                if ($_REQUEST["literal"]) {
                    $o = new Literal($_REQUEST["tripleObject"]);
                } else {
                    $o = new Resource($_REQUEST["tripleObject"]);
                }
                $m->add(new Statement($s, $p, $o));
                //invalidate triples cached in session:
                $_SESSION["triples"] = FALSE;
                print "<h1>Updated statement</h1>\n";
                print "<p>(" . htmlspecialchars($s->getLabel()) . ", " . htmlspecialchars($p->getLabel()) . ", " . htmlspecialchars($o->getLabel()) . ")</p>\n";
                print "<hr/>\n";
            }
            ?>

<?php 
        } else {
            ?>


<h1>Query <?php 
            print $muri;
            ?>
</h1>
   
   <h2>RDQL:</h2>
Esempio n. 3
0
 /**
  * Tells wether the Dataset contains a quad or
  * quads matching a pattern. 
  * 
  * @param Resource $graphName
  * @param Resource $subject
  * @param Resource $predicate
  * @param Resource $object
  * @return boolean
  */
 function containsQuad($graphName, $subject, $predicate, $object)
 {
     if ($graphName != null) {
         if ($this->containsNamedGraph($graphName->getLabel()) !== true) {
             return false;
         }
         return $this->graphs[$graphName->getLabel()]->findFirstMatchingStatement($subject, $predicate, $object) != null;
     }
     foreach ($this->graphs as $graph) {
         if ($graph->findFirstMatchingStatement($subject, $predicate, $object) != null) {
             return true;
         }
     }
     return false;
 }