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


PHP URI::toSPARULPattern方法代码示例

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


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

示例1: smarterDiffItOWLAxioms

    public function smarterDiffItOWLAxioms()
    {
        Timer::start('LiveUpdateDestination::diffItOWLAxioms::total');
        Timer::start('LiveUpdateDestination::diffItOWLAxioms::preparation');
        //a store is needed for language here
        $store = null;
        //$store = new SPARQLToRDFTriple($this->uri, $this->language);
        $propLangFilter = Options::getOption('stringPredicateWithForeignlanguages');
        $graphURI = Options::getOption('graphURI');
        $annotationGraphURI = Options::getOption('annotationGraphURI');
        //generate the regex filter according to namespaces
        //includes language properties
        foreach ($propLangFilter as $one) {
            $this->predicateFilterList[] = $one;
        }
        $tripleDiff = new TripleDiff($this->uri, $this->language, $this->predicateFilterList, $this->objectFilterList, $this->predicateObjectFilterList, $store);
        $filterForNotAnnotatedTriples = $tripleDiff->createFilter($this->predicateFilterList, $this->objectFilterList, $this->predicateObjectFilterList);
        //$langTriples = $store->getRDFTripleForLangProperties($propLangFilter);
        //create a filter for extractors
        $subjectpattern = $this->uri->toSPARULPattern($this->storespecific);
        /*
                    $extractedByPattern = RDFtriple::URI(DBM_ORIGIN)->toSPARULPattern($this->storespecific);
        
                    $extractorFilter = "";
                    $extTerms = array();
                    foreach ($this->activeExtractors as $one){
                         $u = new URI($one);
                         $extPattern = $u->toSPARULPattern($this->storespecific);
                         $extTerms[] = ' ?extractor = '.$extPattern.' ';
                    }
                    foreach ($this->purgeExtractors as $one){
                         $u = new URI($one);
                         $extPattern = $u->toSPARULPattern($this->storespecific);
                         $extTerms[] = ' ?extractor = '.$extPattern.' ';
                    }
                    $extractorFilter = 'FILTER ( '.TripleDiff::assembleTerms($extTerms,'||').') . ';
        */
        $preparation = Timer::stop('LiveUpdateDestination::diffItOWLAxioms::preparation');
        $this->log(TRACE, 'prep needed: ' . $preparation);
        //***********************
        //DELETE ALL NON STATIC TRIPLES
        //**********************
        //delete all triples with the current subject
        //according to the filters
        //do not delete special properties see below
        //Timer::start('LiveUpdateDestination::diffItOWLAxioms::notAnnotated');
        $deleteSPARUL['delete_with_subject_not_static'] = 'DELETE  FROM <' . $graphURI . '>
    { ' . $subjectpattern . ' ?p ?o }
WHERE {
    ' . $subjectpattern . ' ?p ?o .
    FILTER (' . $filterForNotAnnotatedTriples . ').
}';
        //***********************
        //LANGUAGE
        //***********************
        //delete all triples with the current subject
        //where the lang properties with string object
        //from other language version are given, which should stay
        $x = 0;
        //var_dump($langTriples);
        foreach ($propLangFilter as $one) {
            $u = new URI($one, false);
            $deleteSPARUL['delete_english' . $x++] = 'DELETE FROM GRAPH <' . $graphURI . '>
{ ' . $subjectpattern . ' ' . $u->toSPARULPattern($this->storespecific) . ' ?o }
WHERE {
    ' . $subjectpattern . ' ' . $u->toSPARULPattern($this->storespecific) . ' ?o .
    FILTER ( lang(?o) = \'en\').
}';
        }
        //****************************
        //DELETE ANNOTATIONS
        //****************************
        //delete the corresponding annotations
        $deleteSPARUL['delete_corresponding_annotations'] = 'DELETE  FROM <' . $annotationGraphURI . '>
    { ?axiom ?axp  ?axo .  }
WHERE {
    ?axiom <' . OWL_SUBJECT . '> ' . $subjectpattern . ' .
    ?axiom ?axp  ?axo .
}';
        //echo $deleteSPARUL['delete_corresponding_annotations'] ;die;
        //***********************
        //MISSING: DELETE ANOMALIES I.E. source Page
        //***********************
        //TODO go to infobox extractor and
        //add an annotation to all subject/rating objects to which subject they belong
        //and then delete them also
        /*
        $deleteSPARUL['delete_anomalies'] =
        'DELETE  FROM <' . $annotationGraphURI . '>
            { ?axiom ?axp  ?axo .  }
        WHERE {
            ?axiom <'.DBM_ONDELETECASCADE.'> '.$subjectpattern.' .
            ?axiom ?axp  ?axo .
        }';
        */
        //**********************
        //GENERATE NEW TRIPLES
        //**********************
        Timer::start('LiveUpdateDestination::diffItOWLAxioms::insertSPARULCreation');
        $insertSPARUL = array();
//.........这里部分代码省略.........
开发者ID:nsystem1,项目名称:ZeeJong,代码行数:101,代码来源:LiveUpdateDestination_copy_of_old_code_delete_soon.php

示例2: _odbc_sparul_delete_language_oneQuery

    private function _odbc_sparul_delete_language_oneQuery($graphURI, $languageProperties)
    {
        //***********************
        //LANGUAGE
        //***********************
        //delete all triples with the current subject
        //where the lang properties with string object
        //from other language version are given, which should stay
        Timer::start('LiveUpdateDestination::_odbc_sparul_delete_english_total');
        $union = array();
        foreach ($languageProperties as $one) {
            $u = new URI($one, false);
            $union[] = '?p = ' . $u->toSPARULPattern();
        }
        $filter = TripleDiff::assembleTerms($union, '||');
        //$filter ='';
        $sparul = 'DELETE FROM  <' . $graphURI . '>
{ ' . $this->subjectSPARULpattern . ' ?p  ?o }
FROM  <' . $graphURI . '>
WHERE {
    ' . $this->subjectSPARULpattern . '  ?p  ?o .
    FILTER ( ' . $filter . ' && (lang(?o) = \'en\')).
}';
        if ($this->_odbc_sparul_execute($sparul)) {
            $this->counterDelete += 1;
        }
        Timer::stop('LiveUpdateDestination::_odbc_sparul_delete_english_total');
        $this->log(DEBUG, 'deleted language');
        //TESTS>>>>>>>>>>>>
        if (Options::getOption('debug_run_tests')) {
            $this->log(INFO, 'no test for language currently');
        }
        //TESTS<<<<<<<<<<<
    }
开发者ID:nsystem1,项目名称:ZeeJong,代码行数:34,代码来源:LiveUpdateDestination_full_alternatives.php


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