当前位置: 首页>>代码示例>>PHP>>正文


PHP MemModel::addModel方法代码示例

本文整理汇总了PHP中MemModel::addModel方法的典型用法代码示例。如果您正苦于以下问题:PHP MemModel::addModel方法的具体用法?PHP MemModel::addModel怎么用?PHP MemModel::addModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemModel的用法示例。


在下文中一共展示了MemModel::addModel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 function _doFindFromFile($file, &$model)
 {
     $nullVarURIs = array('var:x', 'var:y', 'var:z');
     $mod = new MemModel();
     $mod->load($file);
     $return = new MemModel();
     foreach ($mod->triples as $statement) {
         if (in_array($statement->getLabelSubject(), $nullVarURIs)) {
             $findS = null;
         } else {
             $findS = $statement->getSubject();
         }
         if (in_array($statement->getLabelPredicate(), $nullVarURIs)) {
             $findP = null;
         } else {
             $findP = $statement->getPredicate();
         }
         if (in_array($statement->getLabelObject(), $nullVarURIs)) {
             $findO = null;
         } else {
             $findO = $statement->getObject();
         }
         $return->addModel($model->find($findS, $findP, $findO));
     }
     return $return;
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:26,代码来源:RDFSF_jena_rdfs_test.php

示例2: getSchema

 /**
  * Returns a model, containing all Statements, having a Predicate, that 
  * is supported by the inference. 
  * 
  * @return	object Model
  * @access	public
  */
 function getSchema()
 {
     $res = new MemModel();
     //Search the base-model for all statements, having a Predicate, that
     //is supported by the inference.
     foreach ($this->supportedInference as $inferencePredicateLabel) {
         $res->addModel($this->find(null, new Resource($inferencePredicateLabel), null));
     }
     return $res;
 }
开发者ID:helenadeus,项目名称:s3db.map,代码行数:17,代码来源:InfModel.php

示例3: MemModel

 function _generateRDF()
 {
     $model = new MemModel();
     $model->setBaseURI($this->doclink);
     $proc = new xsltprocessor();
     include_once RDFAPI_INCLUDE_DIR . PACKAGE_SYNTAX_RDF;
     $pars = new RdfParser();
     foreach ($this->stylelink as $key => $value) {
         $xsl = new DomDocument();
         $xsl->load($value);
         $proc->importStyleSheet($xsl);
         $model->addModel($pars->generateModel($proc->transformToXML($this->domdoc), $this->doclink));
     }
     return $model;
 }
开发者ID:VUW-SIM-FIS,项目名称:emiemi,代码行数:15,代码来源:GRDDLParser.php

示例4: RDFSBModel

    /**
     * 
     */
    function test1()
    {
        $inf = new RDFSBModel('http://myRDFSFModel.com');
        $result = new MemModel();
        $parser = new N3Parser();
        $inf->addModel($parser->parse2model('
		<http://example.org/baz1> <http://example.org/bat> <http://example.org/baz2> .
		<http://example.org/bat> <http://www.w3.org/2000/01/rdf-schema#subPropertyOf> <http://example.org/bas> .
		'));
        $result->addModel($parser->parse2model('
		@prefix ns0: <http://example.org/> .
		@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
		ns0:baz1 ns0:bas ns0:baz2 ; ns0:bat ns0:baz2 .
		ns0:bat rdfs:subPropertyOf ns0:bas .
		'));
        $this->assertTrue($inf->equals($result));
        //next test
        $inf->add(new Statement(new Resource('http://example.org/bat'), new Resource('http://www.w3.org/2000/01/rdf-schema#domain'), new Resource('http://example.org/Domain1')));
        $inf->add(new Statement(new Resource('http://example.org/bat'), new Resource('http://www.w3.org/2000/01/rdf-schema#range'), new Resource('http://example.org/Range1')));
        $result = new MemModel();
        $result->addModel($parser->parse2model('
			@prefix ns0: <http://example.org/> .
			@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
			@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
			ns0:baz1 ns0:bas ns0:baz2 ; ns0:bat ns0:baz2 ; a ns0:Domain1 .
			ns0:bat rdfs:domain ns0:Domain1 ; rdfs:range ns0:Range1 ; rdfs:subPropertyOf ns0:bas .
			ns0:baz2 a ns0:Range1 .
		'));
        $this->assertTrue($inf->equals($result));
        // next test
        $inf->add(new Statement(new Resource('http://example.org/bas'), new Resource('http://www.w3.org/2000/01/rdf-schema#domain'), new Resource('http://example.org/Domain2')));
        $inf->add(new Statement(new Resource('http://example.org/bas'), new Resource('http://www.w3.org/2000/01/rdf-schema#range'), new Resource('http://example.org/Range2')));
        $result = new MemModel();
        $result->addModel($parser->parse2model('
		@prefix ns0: <http://example.org/> .
		@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
		@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
		ns0:baz1 ns0:bas ns0:baz2 ; ns0:bat ns0:baz2 ; a ns0:Domain1 ,  ns0:Domain2 .
		ns0:bat rdfs:domain ns0:Domain1 ; rdfs:range ns0:Range1 ; rdfs:subPropertyOf ns0:bas .
		ns0:bas rdfs:domain ns0:Domain2 ; rdfs:range ns0:Range2 .
		ns0:baz2 a ns0:Range1 ,  ns0:Range2 .
		'));
        $this->assertTrue($inf->equals($result));
        //next test
        $inf->add(new Statement(new Resource('http://example.org/Domain2'), new Resource('http://www.w3.org/2000/01/rdf-schema#subClassOf'), new Resource('http://example.org/Domain3')));
        $inf->add(new Statement(new Resource('http://example.org/Domain3'), new Resource('http://www.w3.org/2000/01/rdf-schema#subClassOf'), new Resource('http://example.org/Domain2')));
        $result = new MemModel();
        $result->addModel($parser->parse2model('
		@prefix ns0: <http://example.org/> .
		@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
		@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
		ns0:baz1 ns0:bas ns0:baz2 ; ns0:bat ns0:baz2 ; a ns0:Domain1 ,  ns0:Domain2 ,  ns0:Domain3 .
		ns0:bat rdfs:domain ns0:Domain1 ; rdfs:range ns0:Range1 ; rdfs:subPropertyOf ns0:bas .
		ns0:bas rdfs:domain ns0:Domain2 ; rdfs:range ns0:Range2 .
		ns0:baz2 a ns0:Range1 ,  ns0:Range2 .
		ns0:Domain3 rdfs:subClassOf ns0:Domain2 .
		ns0:Domain2 rdfs:subClassOf ns0:Domain3 .
		'));
        $this->assertTrue($inf->equals($result));
        //next test
        $inf->add(new Statement(new Resource('http://example.org/Range3'), new Resource('http://www.w3.org/2002/07/owl#sameAs'), new Resource('http://example.org/Range2')));
        $result = new MemModel();
        $result->addModel($parser->parse2model('
		@prefix ns0: <http://example.org/> .
		@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
		@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
		@prefix owl: <http://www.w3.org/2002/07/owl#> .
		ns0:baz1 ns0:bas ns0:baz2 ; ns0:bat ns0:baz2 ; a ns0:Domain1 ,  ns0:Domain2 ,  ns0:Domain3 .
		ns0:baz2 a ns0:Range1 ,  ns0:Range2 ,  ns0:Range3 .
		ns0:bat rdfs:domain ns0:Domain1 ; rdfs:range ns0:Range1 ; rdfs:subPropertyOf ns0:bas .
		ns0:bas rdfs:domain ns0:Domain2 ; rdfs:range ns0:Range2 .
		ns0:Range3 owl:sameAs ns0:Range2 .
		ns0:Domain3 rdfs:subClassOf ns0:Domain2 .
		ns0:Domain2 rdfs:subClassOf ns0:Domain3 .
		'));
        $this->assertTrue($inf->equals($result));
        //next test
        $findResult = $inf->find(new Resource('http://example.org/baz2'), null, null);
        $result = new MemModel();
        $result->addModel($parser->parse2model('
		@prefix ns0: <http://example.org/> .
		@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
		ns0:baz2 a ns0:Range1 ,  ns0:Range2 ,  ns0:Range3 .
		'));
        $this->assertTrue($findResult->equals($result));
        //text test
        $inf->remove(new Statement(new Resource('http://example.org/bat'), new Resource('http://www.w3.org/2000/01/rdf-schema#subPropertyOf'), new Resource('http://example.org/bas')));
        $result = new MemModel();
        $result->addModel($parser->parse2model('
		@prefix ns0: <http://example.org/> .
		@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
		@prefix owl: <http://www.w3.org/2002/07/owl#> .
		@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
		ns0:baz1 ns0:bat ns0:baz2 ; a ns0:Domain1 .
		ns0:bas rdfs:domain ns0:Domain2 ; rdfs:range ns0:Range2 .
		ns0:bat rdfs:domain ns0:Domain1 ; rdfs:range ns0:Range1 .
		ns0:baz2 a ns0:Range1 .
//.........这里部分代码省略.........
开发者ID:richardjennings,项目名称:rap,代码行数:101,代码来源:RDFSB_entailment_test.php


注:本文中的MemModel::addModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。