src/Command/ExtractCardinalitiesCommand.php
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $schemaOrgFile = $input->getOption('schemaorg-file');

        $relations = [];
        $schemaOrg = new \EasyRdf_Graph();
        if ('http://' === substr($schemaOrgFile, 0, 7) || 'https://' === substr($schemaOrgFile, 0, 8)) {
            $schemaOrg->load($input->getOption('schemaorg-file'), 'rdfa');
        } else {
            $schemaOrg->parseFile($input->getOption('schemaorg-file'), 'rdfa');
        }

        $relations[] = $schemaOrg;

        $goodRelations = [new \SimpleXMLElement($input->getOption('goodrelations-file'), 0, true)];

        $goodRelationsBridge = new GoodRelationsBridge($goodRelations);
        $cardinalitiesExtractor = new CardinalitiesExtractor($relations, $goodRelationsBridge);
        $result = $cardinalitiesExtractor->extract();

        $output->writeln(json_encode($result, JSON_PRETTY_PRINT));
    }
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $schemaOrgFile = $input->getOption('schemaorg-file');

        $relations = [];
        $schemaOrg = new \EasyRdf_Graph();
        if ('http://' === substr($schemaOrgFile, 0, 7) || 'https://' === substr($schemaOrgFile, 0, 8)) {
            $schemaOrg->load($input->getOption('schemaorg-file'), 'rdfa');
        } else {
            $schemaOrg->parseFile($input->getOption('schemaorg-file'), 'rdfa');
        }

        $relations[] = $schemaOrg;

        $goodRelations = [new \SimpleXMLElement($input->getOption('goodrelations-file'), 0, true)];

        $goodRelationsBridge = new GoodRelationsBridge($goodRelations);
        $cardinalitiesExtractor = new CardinalitiesExtractor($relations, $goodRelationsBridge);
        $result = $cardinalitiesExtractor->extract();

        $output->writeln(json_encode($result, JSON_PRETTY_PRINT));
    }
{@inheritdoc}