Esempio n. 1
0
 public function __construct($file, $namespaces = array(WikiTitle::NS_MAIN))
 {
     parent::__construct();
     $this->logger = \dbpedia\core\DBpediaLogger::getLogger(__CLASS__);
     $this->file = $file;
     $this->namespaces = $namespaces;
 }
Esempio n. 2
0
 private function __construct($ontology, $context)
 {
     $this->logger = DBpediaLogger::getLogger(__CLASS__);
     $this->ontology = $ontology;
     $this->destination = $context->getDestinations()->getDestination(self::DESTINATION_ID);
     $this->parser = new GeocoordinatesParser(GeocoordinatesParser::COORDINATES, true);
 }
Esempio n. 3
0
 private function __construct($node, $ontology, $context)
 {
     $this->node = $node;
     $this->ontology = $ontology;
     $this->destination = $context->getDestinations()->getDestination(self::DESTINATION_ID);
     $this->buildMappings($context);
     $this->logger = DBpediaLogger::getLogger(__CLASS__);
 }
Esempio n. 4
0
 public function __construct($type, $acceptOnlyCoordinatesBelongingToArticle = false)
 {
     $this->type = $type;
     $this->setLanguage('en');
     $this->logger = DBpediaLogger::getLogger(__CLASS__);
     $this->geoCoordinate = new GeoCoordinate();
     $this->acceptOnlyCoordinatesBelongingToArticle = $acceptOnlyCoordinatesBelongingToArticle;
 }
Esempio n. 5
0
 /**
  * @param $ontologyDir ontology dir path, string
  * @param $mappingDir mapping dir path, string
  * @param $configFile config file path, string
  */
 public function __construct($ontologyDir, $mappingDir, $configFile)
 {
     $this->log = \dbpedia\core\DBpediaLogger::getLogger(__CLASS__);
     $this->ontologyDir = PhpUtil::assertDir($ontologyDir, 'ontology dir');
     $this->mappingDir = PhpUtil::assertDir($mappingDir, 'mapping dir');
     PhpUtil::assertString($configFile, 'config file');
     $this->configFile = new LockedFile($configFile);
 }
Esempio n. 6
0
 /**
  * Constructor
  *
  * @param $allowCaching If true, the configuration is loaded from a cache.
  */
 public function __construct($allowCaching = false)
 {
     $this->logger = \dbpedia\core\DBpediaLogger::getLogger(__CLASS__);
     $this->allowCaching = $allowCaching;
     if ($this->allowCaching) {
         $this->logger->info('Using cached ontology and mappings');
     } else {
         $this->logger->info('Start with --cache to use cached ontology and mappings');
     }
 }
Esempio n. 7
0
 public function __construct()
 {
     $this->logger = DBpediaLogger::getLogger(__CLASS__);
     $this->directionDatatype = new EnumerationDataType('Direction');
     $this->directionDatatype->addLiteral('W');
     $this->directionDatatype->addLiteral('E', array('O'));
     $this->directionDatatype->addLiteral('N');
     $this->directionDatatype->addLiteral('S');
     $this->directionParser = new EnumerationParser($this->directionDatatype);
     $dataType = new DataType('xsd:double', 'http://bla');
     $this->numberParser = new NumberParser($dataType);
 }
Esempio n. 8
0
 public function __construct($dataType)
 {
     $this->logger = \dbpedia\core\DBpediaLogger::getLogger(__CLASS__);
     $this->setLanguage('en');
     if ($dataType instanceof DimensionDataType) {
         $this->dimension = $dataType;
         $this->unitNames = $dataType->getUnitLabels();
         $this->stringUnitRegexLabels = self::regexCleaner(join('|', $this->unitNames));
     } elseif ($dataType instanceof UnitDataType) {
         $this->dimension = $dataType->getDimension();
         $this->unitNames = $dataType->getLabels();
         $this->unit = $dataType;
         $this->stringUnitRegexLabels = self::regexCleaner(join('|', $this->dimension->getUnitLabels()));
         $this->isUnitDataType = true;
     } else {
         throw new DataParserException('Wrong parameter.');
     }
 }
Esempio n. 9
0
 public function __construct()
 {
     $this->log = \dbpedia\core\DBpediaLogger::getLogger(__CLASS__);
 }
Esempio n. 10
0
 /**
  * <b>ATTENTION</b>: Sub-classes that define their own constructor <b>MUST</b>
  * call this constructor using parent::__construct(). Initializes logger and parser. 
  */
 public function __construct()
 {
     $this->logger = DBpediaLogger::getLogger(__CLASS__);
     $this->parser = new WikiParser();
 }
Esempio n. 11
0
 /**
  * @param $baseDir must end with a directory separator (slash or backslash)
  * @param $skipNames names (not paths) of files and directories to skip, e.g. '.svn'. 
  * If not given, all files and directories will be included.
  * @param $paths array of strings, paths of files to use, relative to base dir,
  * using forward slashes. If not given, all files and directories will be included.
  */
 public function __construct($baseDir, $skipNames = null, $paths = null)
 {
     parent::__construct();
     $this->logger = \dbpedia\core\DBpediaLogger::getLogger(__CLASS__);
     $this->processor = new FileProcessor($baseDir, $skipNames, $paths);
 }
Esempio n. 12
0
 private function __construct($pages, $ontology, $context)
 {
     $this->logger = \dbpedia\core\DBpediaLogger::getLogger(__CLASS__);
     $this->context = $context;
     $this->buildMappings($pages, $ontology);
 }
Esempio n. 13
0
 private function __construct(Ontology $ontology, ExtractionContext $context)
 {
     $this->ontology = $ontology;
     $this->destination = $context->getDestinations()->getDestination(self::DESTINATION_ID);
     $this->logger = \dbpedia\core\DBpediaLogger::getLogger(__CLASS__);
 }