api-platform / schema-generator

PHP Model Scaffolding from Schema.org and other RDF vocabularies
https://api-platform.com/docs/schema-generator/
MIT License
459 stars 110 forks source link

https://archive.org/services/purl/goodrelations/v1.owl doesn't exist #428

Open ollietb opened 2 months ago

ollietb commented 2 months ago

API Platform version(s) affected: latest schema.phar

Description

I'm trying to generate classes from an OpenAPI yaml file and when I run the command

./schema.phar generate src2/ ./config/schema.yaml  -vv

I get the following error

PHP Warning:  SimpleXMLElement::__construct(https://archive.org/services/purl/goodrelations/v1.owl): Failed to open stream: Connection refused in phar:///var/www/html/schema.phar/src/Schema/Generator.php on line 51
PHP Warning:  SimpleXMLElement::__construct(): I/O warning : failed to load external entity "https://archive.org/services/purl/goodrelations/v1.owl" in phar:///var/www/html/schema.phar/src/Schema/Generator.php on line 51

In Generator.php line 51:

  [Exception]                        
  String could not be parsed as XML  

Exception trace:
  at phar:///var/www/html/schema.phar/src/Schema/Generator.php:51
 SimpleXMLElement->__construct() at phar:///var/www/html/schema.phar/src/Schema/Generator.php:51
 ApiPlatform\SchemaGenerator\Schema\Generator->generate() at phar:///var/www/html/schema.phar/src/Command/GenerateCommand.php:132
 ApiPlatform\SchemaGenerator\Command\GenerateCommand->execute() at phar:///var/www/html/schema.phar/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at phar:///var/www/html/schema.phar/vendor/symfony/console/Application.php:1063
 Symfony\Component\Console\Application->doRunCommand() at phar:///var/www/html/schema.phar/vendor/symfony/console/Application.php:320
 Symfony\Component\Console\Application->doRun() at phar:///var/www/html/schema.phar/vendor/symfony/console/Application.php:174
 Symfony\Component\Console\Application->run() at phar:///var/www/html/schema.phar/bin/schema:26
 require() at /var/www/html/schema.phar:17

How to reproduce

Download an OpenAPI spec and create a schema.yaml

openApi:
    file: 'Street-OpenAPI.yaml'

Then run the generate command.

Is https://archive.org/services/purl/goodrelations/v1.owl an old url that doesn't exist anymore?

dunglas commented 2 months ago

That's weird, the URL resolves for me, but it's a redirection, that's maybe the issue.

gasparakos commented 2 weeks ago

I have the same problem. I found this: http://ebusiness-unibw.org/pipermail/goodrelations/2014-July/000548.html So the url in https://github.com/api-platform/schema-generator/blob/1bb5502b9b7b0cb767f7fbb16f80934bb57fbbdd/src/SchemaGeneratorConfiguration.php#L34 should be: http://www.heppnetz.de/ontologies/goodrelations/v1.owl

dunglas commented 2 weeks ago

Hi, see https://github.com/mfhepp/goodrelations/issues/1#issuecomment-2423945524

PR welcome to fix the tests!