Skip to content

Commit

Permalink
Moved @context to top of the JSON-LD document in all playground examp…
Browse files Browse the repository at this point in the history
…les according the best practice mentioned in the spec.
  • Loading branch information
lanthaler committed Nov 1, 2011
1 parent 1d8755a commit b9a46cd
Showing 1 changed file with 55 additions and 55 deletions.
110 changes: 55 additions & 55 deletions playground/playground-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// add the example of a Person
playground.examples["Person"] =
{
"name": "Manu Sporny",
"homepage": "http://manu.sporny.org/",
"@context":
{
"name": "http://xmlns.com/foaf/0.1/name",
Expand All @@ -26,20 +24,14 @@
{
"homepage": "@iri"
}
}
},
"name": "Manu Sporny",
"homepage": "http://manu.sporny.org/"
};

// add the example of a Place
playground.examples["Place"] =
{
"name": "The Empire State Building",
"description": "The Empire State Building is a 102-story landmark in New York City.",
"image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
"geo":
{
"latitude": "40.75",
"longitude": "73.98"
},
"@context":
{
"name": "http://schema.org/name",
Expand All @@ -55,15 +47,20 @@
"latitude": "xsd:float",
"longitude": "xsd:float"
}
},
"name": "The Empire State Building",
"description": "The Empire State Building is a 102-story landmark in New York City.",
"image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
"geo":
{
"latitude": "40.75",
"longitude": "73.98"
}
};

// add the example of a Event
playground.examples["Event"] =
{
"ical:summary": "Lady Gaga Concert",
"ical:location": "New Orleans Arena, New Orleans, Louisiana, USA",
"ical:dtstart": "2011-04-09T20:00Z",
"@context":
{
"ical": "http://www.w3.org/2002/12/cal/ical#",
Expand All @@ -72,12 +69,29 @@
{
"ical:dtstart": "xsd:dateTime"
}
}
},
"ical:summary": "Lady Gaga Concert",
"ical:location": "New Orleans Arena, New Orleans, Louisiana, USA",
"ical:dtstart": "2011-04-09T20:00Z"
};

// add the example of a Product
playground.examples["Product"] =
{
"@context":
{
"gr": "http://purl.org/goodrelations/v1#",
"pto": "http://www.productontology.org/id/",
"foaf": "http://xmlns.com/foaf/0.1/",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"@coerce":
{
"foaf:page": "@iri",
"gr:acceptedPaymentMethods": "@iri",
"gr:hasBusinessFunction": "@iri",
"gr:hasCurrencyValue": "xsd:float"
}
},
"@subject": "http://example.org/cars/for-sale#tesla",
"@type": "gr:Offering",
"gr:name": "Used Tesla Roadster",
Expand All @@ -94,26 +108,26 @@
"@type": ["gr:Individual", "pto:Vehicle"],
"gr:name": "Tesla Roadster",
"foaf:page": "http://www.teslamotors.com/roadster"
},
"@context":
{
"gr": "http://purl.org/goodrelations/v1#",
"pto": "http://www.productontology.org/id/",
"foaf": "http://xmlns.com/foaf/0.1/",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"@coerce":
{
"foaf:page": "@iri",
"gr:acceptedPaymentMethods": "@iri",
"gr:hasBusinessFunction": "@iri",
"gr:hasCurrencyValue": "xsd:float"
}
}
};

// add the example of a Recipe
playground.examples["Recipe"] =
{
"@context":
{
"name": "http://rdf.data-vocabulary.org/#name",
"ingredient": "http://rdf.data-vocabulary.org/#ingredients",
"yield": "http://rdf.data-vocabulary.org/#yield",
"instructions": "http://rdf.data-vocabulary.org/#instructions",
"step": "http://rdf.data-vocabulary.org/#step",
"description": "http://rdf.data-vocabulary.org/#description",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"@coerce":
{
"step": "xsd:integer"
}
},
"name": "Mojito",
"ingredient": ["12 fresh mint leaves", "1/2 lime, juiced with pulp",
"1 tablespoons white sugar", "1 cup ice cubes",
Expand Down Expand Up @@ -141,26 +155,22 @@
"step": 5,
"description": "Garnish with a lime wedge."
}
],
"@context":
{
"name": "http://rdf.data-vocabulary.org/#name",
"ingredient": "http://rdf.data-vocabulary.org/#ingredients",
"yield": "http://rdf.data-vocabulary.org/#yield",
"instructions": "http://rdf.data-vocabulary.org/#instructions",
"step": "http://rdf.data-vocabulary.org/#step",
"description": "http://rdf.data-vocabulary.org/#description",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"@coerce":
{
"step": "xsd:integer"
}
}
]
};

// add the example of a Library
playground.examples["Library"] =
{
"@context":
{
"@coerce":
{
"ex:contains": "@iri"
},
"dc": "http://purl.org/dc/elements/1.1/",
"ex": "http://example.org/vocab#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@subject": [
{
"@subject": "http://example.org/library",
Expand All @@ -180,17 +190,7 @@
"dc:description": "An introductory chapter on The Republic.",
"dc:title": "The Introduction"
}
],
"@context":
{
"@coerce":
{
"ex:contains": "@iri"
},
"dc": "http://purl.org/dc/elements/1.1/",
"ex": "http://example.org/vocab#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
}
]
};

// add the frame example of a Library
Expand Down

0 comments on commit b9a46cd

Please sign in to comment.