/**
  * @param Snak $snak
  */
 private function processSnak(Snak $snak)
 {
     if ($snak instanceof PropertyValueSnak) {
         $id = $snak->getPropertyId();
         $value = $snak->getDataValue();
         if ($value instanceof StringValue && $this->propertyDataTypeMatcher->isMatchingDataType($id, 'commonsMedia')) {
             $fileName = str_replace(' ', '_', $value->getValue());
             if ($fileName !== '') {
                 $this->fileNames[$fileName] = null;
             }
         }
     }
 }
 /**
  * @param Snak $snak
  */
 private function processSnak(Snak $snak)
 {
     if ($snak instanceof PropertyValueSnak) {
         $id = $snak->getPropertyId();
         $value = $snak->getDataValue();
         if ($value instanceof StringValue && $this->propertyDataTypeMatcher->isMatchingDataType($id, 'url')) {
             $url = $value->getValue();
             if ($url !== '') {
                 $this->urls[$url] = null;
             }
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Extract globe-coordinate DataValues for storing in ParserOutput for GeoData.
  *
  * @param Statement $statement
  */
 public function processStatement(Statement $statement)
 {
     $propertyId = $statement->getMainSnak()->getPropertyId();
     if ($this->propertyDataTypeMatcher->isMatchingDataType($propertyId, 'globe-coordinate')) {
         $rank = $statement->getRank();
         if ($rank !== Statement::RANK_DEPRECATED) {
             $coordinate = $this->extractMainSnakCoord($statement);
             if ($coordinate instanceof Coord) {
                 $key = $this->makeCoordinateKey($propertyId->getSerialization(), $rank);
                 $this->coordinates[$key][] = $coordinate;
             }
         }
     }
 }