Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AIDE] Mise en place fichier RDFA #578

Closed
yacineblr opened this issue Feb 20, 2018 · 1 comment
Closed

[AIDE] Mise en place fichier RDFA #578

yacineblr opened this issue Feb 20, 2018 · 1 comment

Comments

@yacineblr
Copy link

Bonjour,

Après plusieurs essais, je n'arrive pas à mettre en place le fichier RDFA pour utiliser le "schema-generator".

RDFA:
`

    <!-- propriété non reconnue -->
    <p vocab="http://schema.org/" typeof="User">
       <span property="rdfs:label">firstname</span>
       <span property="lastname">Lastname</span>
    </p>
    
    <!-- erreur fatale -->
    <div typeof="rdfs:Class">
        <span class="h" property="rdfs:label">User</span>
    </div>
    <div typeof="rdf:Property">
        <span class="h" property="rdfs:label">firstname</span>
    </div>
`

SCHEMA.YML
`
header: false
checkIsGoodRelations: false
namespaces:
entity: AppBundle\Entity
interface: AppBundle\Model
doctrine:
useCollection: true
validator:
assertType: false
fieldVisibility: private
accessorMethods: true
id:
generationStrategy: auto
debug: true
rdfa:

  • /home/lenovo/Documents/api-platform-2.1.6/app/config/api_platform/vgo.rdfa

types:
User:
parent: BaseUser
namespaces:
class: null
interface: null
properties:
firstname: { nullable: false }
lastname: { nullable: false }
mail: { nullable: false }
phoneNumber: { nullable: false }
newsletter: { nullable: false }
isDriver: { nullable: false }
carModel: { nullable: true }
`

Quand je tente le premier exemple (propriété non reconnue), j'obtiens cette erreur:

[warning] Type "Travel" cannot be found. Using "Thing" type to generate entity.
[error] The property "firstname" (type "User") has an unknown type. Add its type to the config file.
[error] The property "lastname" (type "User") has an unknown type. Add its type to the config file.
[error] The property "mail" (type "User") has an unknown type. Add its type to the config file.
[error] The property "phoneNumber" (type "User") has an unknown type. Add its type to the config file.
[error] The property "newsletter" (type "User") has an unknown type. Add its type to the config file.
[error] The property "isDriver" (type "User") has an unknown type. Add its type to the config file.
[error] The property "carModel" (type "User") has an unknown type. Add its type to the config file.
[error] The property "travelReference" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "travelDate" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "transportationTime" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "zoneStart" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "carModel" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "direction" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "transportation" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "comment" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "place" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "isDriver" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "estimatedDepartureTime" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "creationDate" (type "Thing") has an unknown type. Add its type to the config file.
[error] The property "travelId" (type "Thing") has an unknown type. Add its type to the config file.

Et quand j'utilise seulement le deuxième exemple (erreur fatale), j'obtiens cette erreur:

PHP Fatal error: Uncaught Error: Call to a member function getValue() on null in /home/lenovo/Documents/api-platform-2.1.6/vendor/api-platform/schema-generator/src/CardinalitiesExtractor.php:81
Stack trace:
#0 /home/lenovo/Documents/api-platform-2.1.6/vendor/api-platform/schema-generator/src/CardinalitiesExtractor.php(57): ApiPlatform\SchemaGenerator\CardinalitiesExtractor->extractForProperty(Object(EasyRdf_Resource))
#1 /home/lenovo/Documents/api-platform-2.1.6/vendor/api-platform/schema-generator/src/TypesGenerator.php(99): ApiPlatform\SchemaGenerator\CardinalitiesExtractor->extract()
#2 /home/lenovo/Documents/api-platform-2.1.6/vendor/api-platform/schema-generator/src/Command/GenerateTypesCommand.php(161): ApiPlatform\SchemaGenerator\TypesGenerator->__construct(Object(Twig_Environment), Object(Symfony\Component\Console\Logger\ConsoleLogger), Array, Object(ApiPlatform\SchemaGenerator\CardinalitiesExtractor), Object(ApiPlatform\SchemaGenerator\GoodRelationsBridge))
#3 /home/lenovo/Documents/api-platform-2.1.6/vendor/symfony/ in /home/lenovo/Documents/api-platform-2.1.6/vendor/api-platform/schema-generator/src/CardinalitiesExtractor.php on line 81

@mmeloni
Copy link

mmeloni commented Dec 12, 2018

Insert a comment:
<span property="rdfs:comment">Your comment</span>

@dunglas it's correct that comments need to be mandatory in properties?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants