This is duplication of issue for api-platform/admin api-platform/admin#8
I have followed a guide, I have a tiny simple API build with api-platform but when I try to run Admin I have error in this line:
var range = supportedProperty['http://www.w3.org/ns/hydra/core#property'][0]['http://www.w3.org/2000/01/rdf-schema#range'][0]['@id'];
https://www.dropbox.com/s/9f5muw1ns0wkghv/%D0%A1%D0%BA%D1%80%D0%B8%D0%BD%D1%88%D0%BE%D1%82%202017-05-08%2008.53.59.png?dl=0
API entry point is correct, what else should I do to run this admin interface
Hydra document:
{
"@context":{
"@vocab":"http://localhost:8080/docs.jsonld#",
"hydra":"http://www.w3.org/ns/hydra/core#",
"rdf":"http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs":"http://www.w3.org/2000/01/rdf-schema#",
"xmls":"http://www.w3.org/2001/XMLSchema#",
"owl":"http://www.w3.org/2002/07/owl#",
"domain":{
"@id":"rdfs:domain",
"@type":"@id"
},
"range":{
"@id":"rdfs:range",
"@type":"@id"
},
"subClassOf":{
"@id":"rdfs:subClassOf",
"@type":"@id"
},
"expects":{
"@id":"hydra:expects",
"@type":"@id"
},
"returns":{
"@id":"hydra:returns",
"@type":"@id"
}
},
"@id":"/docs.jsonld",
"hydra:title":"YourTour API",
"hydra:description":"YourTour system management API",
"hydra:entrypoint":"/",
"hydra:supportedClass":[
{
"@id":"http://schema.org/image",
"@type":"hydra:Class",
"rdfs:label":"OfferImage",
"hydra:title":"OfferImage",
"hydra:supportedProperty":[
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#OfferImage/url",
"@type":"rdf:Property",
"rdfs:label":"url",
"domain":"http://schema.org/image",
"range":"xmls:string"
},
"hydra:title":"url",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Image path"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#OfferImage/offer",
"@type":"rdf:Property",
"rdfs:label":"offer",
"domain":"http://schema.org/image"
},
"hydra:title":"offer",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Offer relation"
}
],
"hydra:supportedOperation":[
{
"@type":"hydra:Operation",
"hydra:method":"GET",
"hydra:title":"Retrieves OfferImage resource.",
"rdfs:label":"Retrieves OfferImage resource.",
"returns":"http://schema.org/image"
},
{
"@type":"hydra:ReplaceResourceOperation",
"expects":"http://schema.org/image",
"hydra:method":"PUT",
"hydra:title":"Replaces the OfferImage resource.",
"rdfs:label":"Replaces the OfferImage resource.",
"returns":"http://schema.org/image"
},
{
"@type":"hydra:Operation",
"hydra:method":"DELETE",
"hydra:title":"Deletes the OfferImage resource.",
"rdfs:label":"Deletes the OfferImage resource.",
"returns":"owl:Nothing"
}
],
"hydra:description":"Class TourImages"
},
{
"@id":"http://schema.org/Offer",
"@type":"hydra:Class",
"rdfs:label":"Product",
"hydra:title":"Product",
"hydra:supportedProperty":[
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/image",
"@type":"rdf:Property",
"rdfs:label":"image",
"domain":"http://schema.org/Offer"
},
"hydra:title":"image",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer images collection."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/catalogImage",
"@type":"rdf:Property",
"rdfs:label":"catalogImage",
"domain":"http://schema.org/Offer",
"range":"xmls:string"
},
"hydra:title":"catalogImage",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get catalog image."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/catalogueImage",
"@type":"rdf:Property",
"rdfs:label":"catalogueImage",
"domain":"http://schema.org/Offer",
"range":"xmls:string"
},
"hydra:title":"catalogueImage",
"hydra:required":false,
"hydra:readable":false,
"hydra:writable":true,
"hydra:description":"Set offer catalogue image."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/shortDescription",
"@type":"rdf:Property",
"rdfs:label":"shortDescription",
"domain":"http://schema.org/Offer",
"range":"xmls:string"
},
"hydra:title":"shortDescription",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer short description."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/fullPrice",
"@type":"rdf:Property",
"rdfs:label":"fullPrice",
"domain":"http://schema.org/Offer",
"range":"xmls:decimal"
},
"hydra:title":"fullPrice",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer full price."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/discountedPrice",
"@type":"rdf:Property",
"rdfs:label":"discountedPrice",
"domain":"http://schema.org/Offer",
"range":"xmls:decimal"
},
"hydra:title":"discountedPrice",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer discounted price"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/discountAmount",
"@type":"rdf:Property",
"rdfs:label":"discountAmount",
"domain":"http://schema.org/Offer",
"range":"xmls:decimal"
},
"hydra:title":"discountAmount",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer discount amount"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/soldAmount",
"@type":"rdf:Property",
"rdfs:label":"soldAmount",
"domain":"http://schema.org/Offer",
"range":"xmls:integer"
},
"hydra:title":"soldAmount",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer sold amount."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/fullDescription",
"@type":"rdf:Property",
"rdfs:label":"fullDescription",
"domain":"http://schema.org/Offer",
"range":"xmls:string"
},
"hydra:title":"fullDescription",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer full description."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/discountPercentage",
"@type":"rdf:Property",
"rdfs:label":"discountPercentage",
"domain":"http://schema.org/Offer",
"range":"xmls:decimal"
},
"hydra:title":"discountPercentage",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer discount percentage"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/endDate",
"@type":"rdf:Property",
"rdfs:label":"endDate",
"domain":"http://schema.org/Offer",
"range":"xmls:dateTime"
},
"hydra:title":"endDate",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer end date."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/startDate",
"@type":"rdf:Property",
"rdfs:label":"startDate",
"domain":"http://schema.org/Offer",
"range":"xmls:dateTime"
},
"hydra:title":"startDate",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer start date."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Product/images",
"@type":"hydra:Link",
"rdfs:label":"images",
"domain":"http://schema.org/Offer",
"range":"http://schema.org/image"
},
"hydra:title":"images",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get images"
}
],
"hydra:supportedOperation":[
{
"@type":"hydra:Operation",
"hydra:method":"GET",
"hydra:title":"Retrieves Product resource.",
"rdfs:label":"Retrieves Product resource.",
"returns":"http://schema.org/Offer"
},
{
"@type":"hydra:ReplaceResourceOperation",
"expects":"http://schema.org/Offer",
"hydra:method":"PUT",
"hydra:title":"Replaces the Product resource.",
"rdfs:label":"Replaces the Product resource.",
"returns":"http://schema.org/Offer"
},
{
"@type":"hydra:Operation",
"hydra:method":"DELETE",
"hydra:title":"Deletes the Product resource.",
"rdfs:label":"Deletes the Product resource.",
"returns":"owl:Nothing"
}
],
"hydra:description":"Class Product"
},
{
"@id":"http://schema.org/Offer",
"@type":"hydra:Class",
"rdfs:label":"Tour",
"hydra:title":"Tour",
"hydra:supportedProperty":[
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/days",
"@type":"hydra:Link",
"rdfs:label":"days",
"domain":"http://schema.org/Offer",
"range":"http://schema.org/Offer"
},
"hydra:title":"days",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":false,
"hydra:description":"Offer images collection"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/image",
"@type":"rdf:Property",
"rdfs:label":"image",
"domain":"http://schema.org/Offer"
},
"hydra:title":"image",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer images collection."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/catalogImage",
"@type":"rdf:Property",
"rdfs:label":"catalogImage",
"domain":"http://schema.org/Offer",
"range":"xmls:string"
},
"hydra:title":"catalogImage",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get catalog image."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/catalogueImage",
"@type":"rdf:Property",
"rdfs:label":"catalogueImage",
"domain":"http://schema.org/Offer",
"range":"xmls:string"
},
"hydra:title":"catalogueImage",
"hydra:required":false,
"hydra:readable":false,
"hydra:writable":true,
"hydra:description":"Set offer catalogue image."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/shortDescription",
"@type":"rdf:Property",
"rdfs:label":"shortDescription",
"domain":"http://schema.org/Offer",
"range":"xmls:string"
},
"hydra:title":"shortDescription",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer short description."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/fullPrice",
"@type":"rdf:Property",
"rdfs:label":"fullPrice",
"domain":"http://schema.org/Offer",
"range":"xmls:decimal"
},
"hydra:title":"fullPrice",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer full price."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/discountedPrice",
"@type":"rdf:Property",
"rdfs:label":"discountedPrice",
"domain":"http://schema.org/Offer",
"range":"xmls:decimal"
},
"hydra:title":"discountedPrice",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer discounted price"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/discountAmount",
"@type":"rdf:Property",
"rdfs:label":"discountAmount",
"domain":"http://schema.org/Offer",
"range":"xmls:decimal"
},
"hydra:title":"discountAmount",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer discount amount"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/soldAmount",
"@type":"rdf:Property",
"rdfs:label":"soldAmount",
"domain":"http://schema.org/Offer",
"range":"xmls:integer"
},
"hydra:title":"soldAmount",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer sold amount."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/fullDescription",
"@type":"rdf:Property",
"rdfs:label":"fullDescription",
"domain":"http://schema.org/Offer",
"range":"xmls:string"
},
"hydra:title":"fullDescription",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer full description."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/discountPercentage",
"@type":"rdf:Property",
"rdfs:label":"discountPercentage",
"domain":"http://schema.org/Offer",
"range":"xmls:decimal"
},
"hydra:title":"discountPercentage",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer discount percentage"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/endDate",
"@type":"rdf:Property",
"rdfs:label":"endDate",
"domain":"http://schema.org/Offer",
"range":"xmls:dateTime"
},
"hydra:title":"endDate",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer end date."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/startDate",
"@type":"rdf:Property",
"rdfs:label":"startDate",
"domain":"http://schema.org/Offer",
"range":"xmls:dateTime"
},
"hydra:title":"startDate",
"hydra:required":true,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get offer start date."
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Tour/images",
"@type":"hydra:Link",
"rdfs:label":"images",
"domain":"http://schema.org/Offer",
"range":"http://schema.org/image"
},
"hydra:title":"images",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Get images"
}
],
"hydra:supportedOperation":[
{
"@type":"hydra:Operation",
"hydra:method":"GET",
"hydra:title":"Retrieves Tour resource.",
"rdfs:label":"Retrieves Tour resource.",
"returns":"http://schema.org/Offer"
},
{
"@type":"hydra:ReplaceResourceOperation",
"expects":"http://schema.org/Offer",
"hydra:method":"PUT",
"hydra:title":"Replaces the Tour resource.",
"rdfs:label":"Replaces the Tour resource.",
"returns":"http://schema.org/Offer"
},
{
"@type":"hydra:Operation",
"hydra:method":"DELETE",
"hydra:title":"Deletes the Tour resource.",
"rdfs:label":"Deletes the Tour resource.",
"returns":"owl:Nothing"
}
],
"hydra:description":"Tour"
},
{
"@id":"http://schema.org/Offer",
"@type":"hydra:Class",
"rdfs:label":"TourDay",
"hydra:title":"TourDay",
"hydra:supportedProperty":[
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#TourDay/tour",
"@type":"hydra:Link",
"rdfs:label":"tour",
"domain":"http://schema.org/Offer",
"range":"http://schema.org/Offer"
},
"hydra:title":"tour",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":false,
"hydra:description":"Tour relation"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#TourDay/dayNumber",
"@type":"rdf:Property",
"rdfs:label":"dayNumber",
"domain":"http://schema.org/Offer",
"range":"xmls:integer"
},
"hydra:title":"dayNumber",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Tour day number"
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#TourDay/dayDescription",
"@type":"rdf:Property",
"rdfs:label":"dayDescription",
"domain":"http://schema.org/Offer",
"range":"xmls:string"
},
"hydra:title":"dayDescription",
"hydra:required":false,
"hydra:readable":true,
"hydra:writable":true,
"hydra:description":"Tour day description"
}
],
"hydra:supportedOperation":[
{
"@type":"hydra:Operation",
"hydra:method":"GET",
"hydra:title":"Retrieves TourDay resource.",
"rdfs:label":"Retrieves TourDay resource.",
"returns":"http://schema.org/Offer"
},
{
"@type":"hydra:ReplaceResourceOperation",
"expects":"http://schema.org/Offer",
"hydra:method":"PUT",
"hydra:title":"Replaces the TourDay resource.",
"rdfs:label":"Replaces the TourDay resource.",
"returns":"http://schema.org/Offer"
},
{
"@type":"hydra:Operation",
"hydra:method":"DELETE",
"hydra:title":"Deletes the TourDay resource.",
"rdfs:label":"Deletes the TourDay resource.",
"returns":"owl:Nothing"
}
],
"hydra:description":"Tour program day."
},
{
"@id":"#Entrypoint",
"@type":"hydra:Class",
"hydra:title":"The API entrypoint",
"hydra:supportedProperty":[
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Entrypoint/offerImage",
"@type":"hydra:Link",
"domain":"#Entrypoint",
"rdfs:label":"The collection of OfferImage resources",
"range":"hydra:PagedCollection",
"hydra:supportedOperation":[
{
"@type":"hydra:Operation",
"hydra:method":"GET",
"hydra:title":"Retrieves the collection of OfferImage resources.",
"rdfs:label":"Retrieves the collection of OfferImage resources.",
"returns":"hydra:PagedCollection"
},
{
"@type":"hydra:CreateResourceOperation",
"expects":"http://schema.org/image",
"hydra:method":"POST",
"hydra:title":"Creates a OfferImage resource.",
"rdfs:label":"Creates a OfferImage resource.",
"returns":"http://schema.org/image"
}
]
},
"hydra:title":"The collection of OfferImage resources",
"hydra:readable":true,
"hydra:writable":false
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Entrypoint/product",
"@type":"hydra:Link",
"domain":"#Entrypoint",
"rdfs:label":"The collection of Product resources",
"range":"hydra:PagedCollection",
"hydra:supportedOperation":[
{
"@type":"hydra:Operation",
"hydra:method":"GET",
"hydra:title":"Retrieves the collection of Product resources.",
"rdfs:label":"Retrieves the collection of Product resources.",
"returns":"hydra:PagedCollection"
},
{
"@type":"hydra:CreateResourceOperation",
"expects":"http://schema.org/Offer",
"hydra:method":"POST",
"hydra:title":"Creates a Product resource.",
"rdfs:label":"Creates a Product resource.",
"returns":"http://schema.org/Offer"
}
]
},
"hydra:title":"The collection of Product resources",
"hydra:readable":true,
"hydra:writable":false
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Entrypoint/tour",
"@type":"hydra:Link",
"domain":"#Entrypoint",
"rdfs:label":"The collection of Tour resources",
"range":"hydra:PagedCollection",
"hydra:supportedOperation":[
{
"@type":"hydra:Operation",
"hydra:method":"GET",
"hydra:title":"Retrieves the collection of Tour resources.",
"rdfs:label":"Retrieves the collection of Tour resources.",
"returns":"hydra:PagedCollection"
},
{
"@type":"hydra:CreateResourceOperation",
"expects":"http://schema.org/Offer",
"hydra:method":"POST",
"hydra:title":"Creates a Tour resource.",
"rdfs:label":"Creates a Tour resource.",
"returns":"http://schema.org/Offer"
}
]
},
"hydra:title":"The collection of Tour resources",
"hydra:readable":true,
"hydra:writable":false
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#Entrypoint/tourDay",
"@type":"hydra:Link",
"domain":"#Entrypoint",
"rdfs:label":"The collection of TourDay resources",
"range":"hydra:PagedCollection",
"hydra:supportedOperation":[
{
"@type":"hydra:Operation",
"hydra:method":"GET",
"hydra:title":"Retrieves the collection of TourDay resources.",
"rdfs:label":"Retrieves the collection of TourDay resources.",
"returns":"hydra:PagedCollection"
},
{
"@type":"hydra:CreateResourceOperation",
"expects":"http://schema.org/Offer",
"hydra:method":"POST",
"hydra:title":"Creates a TourDay resource.",
"rdfs:label":"Creates a TourDay resource.",
"returns":"http://schema.org/Offer"
}
]
},
"hydra:title":"The collection of TourDay resources",
"hydra:readable":true,
"hydra:writable":false
}
],
"hydra:supportedOperation":{
"@type":"hydra:Operation",
"hydra:method":"GET",
"rdfs:label":"The API entrypoint.",
"returns":"#EntryPoint"
}
},
{
"@id":"#ConstraintViolation",
"@type":"hydra:Class",
"hydra:title":"A constraint violation",
"hydra:supportedProperty":[
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#ConstraintViolation/propertyPath",
"@type":"rdf:Property",
"rdfs:label":"propertyPath",
"domain":"#ConstraintViolation",
"range":"xmls:string"
},
"hydra:title":"propertyPath",
"hydra:description":"The property path of the violation",
"hydra:readable":true,
"hydra:writable":false
},
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#ConstraintViolation/message",
"@type":"rdf:Property",
"rdfs:label":"message",
"domain":"#ConstraintViolation",
"range":"xmls:string"
},
"hydra:title":"message",
"hydra:description":"The message associated with the violation",
"hydra:readable":true,
"hydra:writable":false
}
]
},
{
"@id":"#ConstraintViolationList",
"@type":"hydra:Class",
"subClassOf":"hydra:Error",
"hydra:title":"A constraint violation list",
"hydra:supportedProperty":[
{
"@type":"hydra:SupportedProperty",
"hydra:property":{
"@id":"#ConstraintViolationList/violations",
"@type":"rdf:Property",
"rdfs:label":"violations",
"domain":"#ConstraintViolationList",
"range":"#ConstraintViolation"
},
"hydra:title":"violations",
"hydra:description":"The violations",
"hydra:readable":true,
"hydra:writable":false
}
]
}
]
}
@dunglas