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


PHP ARC2::getSer方法代码示例

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


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

示例1: serialise

 /**
  * Serialise an EasyRdf\Graph into RDF format of choice.
  *
  * @param Graph  $graph   An EasyRdf\Graph object.
  * @param string $format  The name of the format to convert to.
  * @param array  $options
  *
  * @throws Exception
  *
  * @return string              The RDF in the new desired format.
  */
 public function serialise($graph, $format, array $options = array())
 {
     parent::checkSerialiseParams($graph, $format);
     if (array_key_exists($format, self::$supportedTypes)) {
         $className = self::$supportedTypes[$format];
     } else {
         throw new Exception("EasyRdf\\Serialiser\\Arc does not support: {$format}");
     }
     $serialiser = \ARC2::getSer($className);
     if ($serialiser) {
         return $serialiser->getSerializedIndex(parent::serialise($graph, 'php'));
     } else {
         throw new Exception("ARC2 failed to get a {$className} serialiser.");
     }
 }
开发者ID:hackerceo,项目名称:easyrdf,代码行数:26,代码来源:Arc.php

示例2: serialise

 /**
  * Serialise an EasyRdf_Graph into RDF format of choice.
  *
  * @param string  $graph   An EasyRdf_Graph object.
  * @param string  $format  The name of the format to convert to.
  * @return string          The RDF in the new desired format.
  */
 public function serialise($graph, $format)
 {
     parent::checkSerialiseParams($graph, $format);
     if (array_key_exists($format, self::$_supportedTypes)) {
         $className = self::$_supportedTypes[$format];
     } else {
         throw new EasyRdf_Exception("Serialising documents to {$format} " . "is not supported by EasyRdf_Serialiser_Arc.");
     }
     $serialiser = ARC2::getSer($className);
     if ($serialiser) {
         return $serialiser->getSerializedIndex(parent::serialise($graph, 'php'));
     } else {
         throw new EasyRdf_Exception("ARC2 failed to get a {$className} serialiser.");
     }
 }
开发者ID:nhukhanhdl,项目名称:easyrdf,代码行数:22,代码来源:Arc.php

示例3: getPOSHRDFSerializer

 function getPOSHRDFSerializer($a = '')
 {
     return ARC2::getSer('POSHRDF', $a);
 }
开发者ID:brondsem,项目名称:familysite,代码行数:4,代码来源:ARC2.php

示例4: getRSS10Serializer

 function getRSS10Serializer($a = '')
 {
     return ARC2::getSer('RSS10', $a);
 }
开发者ID:patrickmj,项目名称:Rubrick,代码行数:4,代码来源:ARC2.php

示例5: serialize

 public function serialize($type = "RDFXML")
 {
     $serializer = ARC2::getSer($type, array("ns" => $this->g->ns));
     return $serializer->getSerializedTriples($this->toArcTriples());
 }
开发者ID:rebe100x,项目名称:YAKREP,代码行数:5,代码来源:Graphite.php

示例6: serialise

 /**
  * Serialise an EasyRdf_Graph into RDF format of choice.
  *
  * @param string $graph An EasyRdf_Graph object.
  * @param string $format The name of the format to convert to.
  * @return string The RDF in the new desired format.
  */
 public function serialise($graph, $format)
 {
     if ($graph == null or !is_object($graph) or get_class($graph) != 'EasyRdf_Graph') {
         throw new InvalidArgumentException("\$graph should be an EasyRdf_Graph object and cannot be null");
     }
     if ($format == null or !is_string($format) or $format == '') {
         throw new InvalidArgumentException("\$format should be a string and cannot be null or empty");
     }
     $rdfphp = $this->to_rdfphp($graph);
     if ($format == 'php') {
         return $rdfphp;
     }
     if (array_key_exists($format, self::$_supportedTypes)) {
         $className = self::$_supportedTypes[$format];
     } else {
         throw new EasyRdf_Exception("Serialising documents to {$format} " . "is not supported by EasyRdf_Serialiser_Arc.");
     }
     $serialiser = ARC2::getSer($className);
     if ($serialiser) {
         return $serialiser->getSerializedIndex($rdfphp);
     } else {
         throw new EasyRdf_Exception("ARC2 failed to get a {$className} serialiser.");
     }
 }
开发者ID:richardhodgson,项目名称:console,代码行数:31,代码来源:Arc.php

示例7: getJSONLDSerializer

 static function getJSONLDSerializer($a = '')
 {
     return ARC2::getSer('JSONLD', $a);
 }
开发者ID:semsol,项目名称:arc2,代码行数:4,代码来源:ARC2.php

示例8: serialize

 /**
  * Returns the serialization of the entire RDF graph in memory using one of Arc2's serializers. By default the RDF/XML serializer is used, but others (try passing "Turtle" or "NTriples") can be used - see the Arc2 documentation.
  */
 public function serialize($type = "RDFXML")
 {
     $ns = $this->ns;
     unset($ns["dct"]);
     // use dcterms for preference. duplicates seem to cause
     // bugs in the serialiser
     $serializer = ARC2::getSer($type, array("ns" => $ns));
     return $serializer->getSerializedTriples($this->toArcTriples());
 }
开发者ID:cgutteridge,项目名称:graphite,代码行数:12,代码来源:Graphite.php


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