protected function EasyRdf_Serialiser::reversePropertyCount

Protected method to get the number of reverse properties for a resource If a resource only has a single property, the number of values for that property is returned instead. @ignore

3 calls to EasyRdf_Serialiser::reversePropertyCount()
EasyRdf_Serialiser_RdfXml::rdfxmlObject in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/RdfXml.php
Protected method to serialise an object node into an XML object @ignore
EasyRdf_Serialiser_Turtle::serialise in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Turtle.php
Serialise an EasyRdf_Graph to Turtle.
EasyRdf_Serialiser_Turtle::serialiseProperties in drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser/Turtle.php
Protected method to serialise the properties of a resource @ignore

File

drupal/core/vendor/easyrdf/easyrdf/lib/EasyRdf/Serialiser.php, line 93

Class

EasyRdf_Serialiser
Parent class for the EasyRdf serialiser

Code

protected function reversePropertyCount($resource) {
  $properties = $resource
    ->reversePropertyUris();
  $count = count($properties);
  if ($count == 1) {
    $property = $properties[0];
    return $resource
      ->count("^<{$property}>");
  }
  else {
    return $count;
  }
}