Skip to content

Instantly share code, notes, and snippets.

@jenzopr
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenzopr/3fb7b358be060711c7da to your computer and use it in GitHub Desktop.
Save jenzopr/3fb7b358be060711c7da to your computer and use it in GitHub Desktop.
Example: ALPS and Cj - nested and bulk data
{
"collection" : {
"version" : "1.0",
"href" : "http://example.com/collection",
"links" : [
{"rel" : "profile", "href" : "https://gist.github.com/jenzopr/3fb7b358be060711c7da#file-profile-xml"},
],
"items" : [],
"queries" : [
{
"href" : "http://example.com/collection/search",
"rel" : "search",
"data" : [
{"name" : "title", "value" : ""},
{"name" : "term", "value" : "", "type" : "property"},
{"name" : "value", "value" : "", "type" : "property"},
],
},
],
"template" : {
"data" : [
{"name" : "title", "value" : "", "promt" : "Please specify a title."},
// option 1: Include term and value in a list
{"name" : "property", "value" : [{"name" : "term"},{"name" : "value"}]},
// option 2: include a type property to indicate the nested structure
// this means having one anonymous object per nested semantic descriptor
{"type" : "property", "name" : "term", "value" : ""},
{"type" : "property", "name" : "value", "value" : ""}
]
}
}
}
<?xml version="1.0" ?>
<alps>
<doc>An example profile to explore use of nested data structures.</doc>
<!-- base elements -->
<descriptor id="title" type="semantic">
<doc>The objects title.</doc>
</descriptor>
<descriptor id="property" type="semantic">
<descriptor id="term" type="semantic">
<doc>Name of the property (e.g. blood group).</doc>
</descriptor>
<descriptor id="value" type="semantic">
<doc>The value of the property (e.g. AB).</doc>
</descriptor>
<descriptor>
<!-- state transitions -->
<descriptor href="http://alps.io/iana/relations.xml#search" />
</alps>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment