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


PHP ARC2::getRDFJSONSerializer方法代码示例

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


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

示例1: toRDFJSON

 function toRDFJSON($asObject = false)
 {
     $index = $this->toIndex();
     $ser = ARC2::getRDFJSONSerializer(array('ns' => $this->ns));
     if ($asObject) {
         return json_decode($ser->getSerializedIndex($index));
     }
     return $ser->getSerializedIndex($index);
 }
开发者ID:patrickmj,项目名称:Rubrick,代码行数:9,代码来源:PMJ_ResourceGraphPlugin.php

示例2: printGraph

 public function printGraph()
 {
     /* Serializer instantiation */
     $ser = \ARC2::getRDFJSONSerializer();
     foreach ($this->objectToPrint as $class => $prop) {
         $triples = $prop->getTriples();
     }
     /* Serialize a triples array */
     echo $ser->getSerializedTriples($triples);
 }
开发者ID:tdt,项目名称:formatters,代码行数:10,代码来源:JSON.php

示例3: getRDFJSONDescribeResultDoc

 function getRDFJSONDescribeResultDoc($r)
 {
     $this->setHeader('content-type', 'Content-Type: application/json');
     $index = $r['result'];
     $ser = ARC2::getRDFJSONSerializer($this->a);
     $dur = $r['query_time'];
     $r = $ser->getSerializedIndex($index);
     if (($v = $this->p('jsonp')) || ($v = $this->p('callback'))) {
         $r = $v . '(' . $r . ')';
     }
     return $r;
 }
开发者ID:johnulist,项目名称:arc2,代码行数:12,代码来源:ARC2_StoreEndpoint.php

示例4: serializeRdf

 public static function serializeRdf($data, $extension = 'rdf')
 {
     global $conf;
     global $lodspk;
     $ser;
     $dPointer;
     $docs = Utils::travelTree($data);
     require_once $conf['home'] . 'lib/arc2/ARC2.php';
     $parser = ARC2::getRDFParser();
     $triples = array();
     foreach ($docs as $d) {
         $parser->parse($conf['basedir'], $d);
         $t = $parser->getTriples();
         $triples = array_merge($triples, $t);
     }
     if ($lodspk['mirror_external_uris']) {
         global $uri;
         global $localUri;
         $t = array();
         $t['s'] = $localUri;
         $t['s_type'] = 'uri';
         $t['p'] = "http://www.w3.org/2002/07/owl#sameAs";
         $t['o'] = $uri;
         $t['o_type'] = 'uri';
         array_push($triples, $t);
         $t['p'] = "http://www.w3.org/2000/10/swap/pim/contact#preferredURI";
         array_push($triples, $t);
     }
     switch ($extension) {
         case 'ttl':
             $ser = ARC2::getTurtleSerializer();
             break;
         case 'nt':
             $ser = ARC2::getNTriplesSerializer();
             break;
         case 'json':
             $ser = ARC2::getRDFJSONSerializer();
             break;
         case 'rdf':
             $ser = ARC2::getRDFXMLSerializer();
             break;
         case 'html':
             return array("content" => $triples, "serialized" => false);
             break;
         default:
             $ser = null;
     }
     if ($ser != null) {
         $doc = $ser->getSerializedTriples($triples);
     } else {
         $doc = var_export($data, true);
     }
     return array("content" => $doc, "serialized" => true);
 }
开发者ID:OpenDataServices,项目名称:lodspeakr,代码行数:54,代码来源:Utils.php

示例5: header

        break;
    default:
        $ser = ARC2::getTurtleSerializer(array('ns' => $ns));
        break;
}
$output = "";
if ($outformat == "turtle") {
    $output = $ser->getSerializedTriples($triples);
    header("Content-Type: text/turtle");
} else {
    if ($outformat == "rdfxml") {
        $output = $ser->getSerializedTriples($triples);
        header("Content-Type: application/rdf+xml");
    } else {
        if ($outformat == "json") {
            $ser = ARC2::getRDFJSONSerializer(array('ns' => $ns));
            $output = $ser->getSerializedTriples($triples);
        } else {
            if ($outformat == "ntriples") {
                $output = $ser->getSerializedTriples($triples);
                header("Content-Type: text/plain");
            } else {
                if ($outformat == "text") {
                    $output = getTextFromTriples($triples);
                    header("Content-Type: text/plain");
                } else {
                    $output = $ser->getSerializedTriples($triples);
                    header("Content-Type: text/turtle");
                }
            }
        }
开发者ID:dougj0220,项目名称:software,代码行数:31,代码来源:nif-ws.php

示例6: toRDFJSON

 function toRDFJSON()
 {
     $ser = ARC2::getRDFJSONSerializer(array('ns' => $this->ns));
     return $ser->getSerializedIndex($this->index);
 }
开发者ID:patrickmj,项目名称:Rubrick,代码行数:5,代码来源:PMJ_ResourcePlusPlugin.php


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