Add purpose to flatten manifest.
authorGregg Kellogg <gregg@kellogg-assoc.com>
Sat, 17 Aug 2013 17:34:18 -0700
changeset 1898 5a5fef640b2a
parent 1897 42e610a84fa1
child 1899 91aec396f71c
Add purpose to flatten manifest.
test-suite/tests/flatten-manifest.jsonld
--- a/test-suite/tests/flatten-manifest.jsonld	Sat Aug 17 17:08:09 2013 -0700
+++ b/test-suite/tests/flatten-manifest.jsonld	Sat Aug 17 17:34:18 2013 -0700
@@ -9,259 +9,302 @@
     {
       "@id": "#t0001",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "id",
+      "name": "drop free-floating nodes",
+      "purpose": "Flattening drops unreferenced nodes having only @id",
       "input": "flatten-0001-in.jsonld",
       "expect": "flatten-0001-out.jsonld"
     }, {
       "@id": "#t0002",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "basic",
+      "purpose": "Flattening terms with different types of values",
       "input": "flatten-0002-in.jsonld",
       "expect": "flatten-0002-out.jsonld"
     }, {
       "@id": "#t0003",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "drop null and unmapped properties",
+      "purpose": "Verifies that null values and unmapped properties are removed from expanded output",
       "input": "flatten-0003-in.jsonld",
       "expect": "flatten-0003-out.jsonld"
     }, {
       "@id": "#t0004",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "optimize @set, keep empty arrays",
+      "purpose": "Uses of @set are removed in expansion; values of @set, or just plain values which are empty arrays are retained",
       "input": "flatten-0004-in.jsonld",
       "expect": "flatten-0004-out.jsonld"
     }, {
       "@id": "#t0005",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "do not expand aliased @id/@type",
+      "purpose": "If a keyword is aliased, it is not used when flattening",
       "input": "flatten-0005-in.jsonld",
       "expect": "flatten-0005-out.jsonld"
     }, {
       "@id": "#t0006",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "alias keywords",
+      "purpose": "Aliased keywords expand in resulting document",
       "input": "flatten-0006-in.jsonld",
       "expect": "flatten-0006-out.jsonld"
     }, {
       "@id": "#t0007",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "date type-coercion",
+      "purpose": "Expand strings to expanded value with @type: xsd:dateTime",
       "input": "flatten-0007-in.jsonld",
       "expect": "flatten-0007-out.jsonld"
     }, {
       "@id": "#t0008",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "@value with @language",
+      "purpose": "Keep expanded values with @language, drop non-conforming value objects containing just @language",
       "input": "flatten-0008-in.jsonld",
       "expect": "flatten-0008-out.jsonld"
     }, {
       "@id": "#t0009",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "@graph with terms",
+      "purpose": "Use of @graph to contain multiple nodes within array",
       "input": "flatten-0009-in.jsonld",
       "expect": "flatten-0009-out.jsonld"
     }, {
       "@id": "#t0010",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "native types",
+      "purpose": "Flattening native scalar retains native scalar within expanded value",
       "input": "flatten-0010-in.jsonld",
       "expect": "flatten-0010-out.jsonld"
     }, {
       "@id": "#t0011",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "coerced @id",
+      "purpose": "A value of a property with @type: @id coercion expands to a node reference",
       "input": "flatten-0011-in.jsonld",
       "expect": "flatten-0011-out.jsonld"
     }, {
       "@id": "#t0012",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "@graph with embed",
+      "purpose": "Flattening objects containing chained objects flattens all objects",
       "input": "flatten-0012-in.jsonld",
       "expect": "flatten-0012-out.jsonld"
     }, {
       "@id": "#t0013",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "flatten already expanded",
+      "purpose": "Flattening an expanded/flattened document maintains input document",
       "input": "flatten-0013-in.jsonld",
       "expect": "flatten-0013-out.jsonld"
     }, {
       "@id": "#t0014",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "@set of @value objects with keyword aliases",
+      "purpose": "Flattening aliased @set and @value",
       "input": "flatten-0014-in.jsonld",
       "expect": "flatten-0014-out.jsonld"
     }, {
       "@id": "#t0015",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "collapse set of sets, keep empty lists",
+      "purpose": "An array of multiple @set nodes are collapsed into a single array",
       "input": "flatten-0015-in.jsonld",
       "expect": "flatten-0015-out.jsonld"
     }, {
       "@id": "#t0016",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "context reset",
+      "purpose": "Setting @context to null within an embedded object resets back to initial context state",
       "input": "flatten-0016-in.jsonld",
       "expect": "flatten-0016-out.jsonld"
     }, {
       "@id": "#t0017",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "@graph and @id aliased",
+      "purpose": "Flattening with @graph and @id aliases",
       "input": "flatten-0017-in.jsonld",
       "expect": "flatten-0017-out.jsonld"
     }, {
       "@id": "#t0018",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "override default @language in terms; only language-tag strings",
+      "name": "override default @language",
+      "purpose": "override default @language in terms; only language-tag strings",
       "input": "flatten-0018-in.jsonld",
       "expect": "flatten-0018-out.jsonld"
     }, {
       "@id": "#t0019",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "remove @value = null",
+      "purpose": "Flattening a value of null removes the value",
       "input": "flatten-0019-in.jsonld",
       "expect": "flatten-0019-out.jsonld"
     }, {
       "@id": "#t0020",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "do not remove @graph if not at top-level",
+      "purpose": "@graph used under a node is retained",
       "input": "flatten-0020-in.jsonld",
       "expect": "flatten-0020-out.jsonld"
     }, {
       "@id": "#t0021",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "do not remove @graph at top-level if not only property",
+      "purpose": "@graph used at the top level is retained if there are other properties",
       "input": "flatten-0021-in.jsonld",
       "expect": "flatten-0021-out.jsonld"
     }, {
       "@id": "#t0022",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "flatten value with default language",
+      "purpose": "Flattening with a default language applies that language to string values",
       "input": "flatten-0022-in.jsonld",
       "expect": "flatten-0022-out.jsonld"
     }, {
       "@id": "#t0023",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "Flattening lists and sets with properties having coercion coerces list/set values",
+      "name": "Flattening list/set with coercion",
+      "purpose": "Flattening lists and sets with properties having coercion coerces list/set values",
       "input": "flatten-0023-in.jsonld",
       "expect": "flatten-0023-out.jsonld"
     }, {
       "@id": "#t0024",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Multiple contexts",
+      "purpose": "Tests that contexts in an array are merged",
       "input": "flatten-0024-in.jsonld",
       "expect": "flatten-0024-out.jsonld"
     }, {
       "@id": "#t0025",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Problematic IRI flattening tests",
+      "purpose": "Flattening different kinds of terms and Compact IRIs",
       "input": "flatten-0025-in.jsonld",
       "expect": "flatten-0025-out.jsonld"
     }, {
       "@id": "#t0026",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "Flattening term mapping to @type uses @type syntax",
+      "name": "Term definition with @id: @type",
+      "purpose": "Flattening term mapping to @type uses @type syntax",
       "input": "flatten-0026-in.jsonld",
       "expect": "flatten-0026-out.jsonld"
     }, {
       "@id": "#t0027",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "Keep duplicate values in @list but remove them in @set",
+      "name": "Duplicate values in @list and @set",
+      "purpose": "Duplicate values in @list and @set are not merged",
       "input": "flatten-0027-in.jsonld",
       "expect": "flatten-0027-out.jsonld"
     }, {
       "@id": "#t0028",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Use @vocab in properties and @type but not in @id",
+      "purpose": "@vocab is used to compact properties and @type, but is not used for @id",
       "input": "flatten-0028-in.jsonld",
       "expect": "flatten-0028-out.jsonld"
     }, {
       "@id": "#t0029",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Relative IRIs",
+      "purpose": "@base is used to compact @id; test with different relative IRIs",
       "input": "flatten-0029-in.jsonld",
       "expect": "flatten-0029-out.jsonld"
     }, {
       "@id": "#t0030",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Language maps",
+      "purpose": "Language Maps expand values to include @language",
       "input": "flatten-0030-in.jsonld",
       "expect": "flatten-0030-out.jsonld"
     }, {
       "@id": "#t0031",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "type-coercion of native types",
+      "purpose": "Flattening native types with type coercion adds the coerced type to an expanded value representation and retains the native value representation",
       "input": "flatten-0031-in.jsonld",
       "expect": "flatten-0031-out.jsonld"
     }, {
       "@id": "#t0032",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "Mapping a term to null decouples it from @vocab",
+      "name": "Null term and @vocab",
+      "purpose": "Mapping a term to null decouples it from @vocab",
       "input": "flatten-0032-in.jsonld",
       "expect": "flatten-0032-out.jsonld"
     }, {
       "@id": "#t0033",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Using @vocab with with type-coercion",
+      "purpose": "Verifies that terms can be defined using @vocab",
       "input": "flatten-0033-in.jsonld",
       "expect": "flatten-0033-out.jsonld"
     }, {
       "@id": "#t0034",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Multiple properties expanding to the same IRI",
+      "purpose": "Verifies multiple values from separate terms are deterministically made multiple values of the IRI associated with the terms",
       "input": "flatten-0034-in.jsonld",
       "expect": "flatten-0034-out.jsonld"
     }, {
       "@id": "#t0035",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Using language maps with @vocab, a default language, and a colliding property",
+      "purpose": "Pathological tests of language maps",
       "input": "flatten-0035-in.jsonld",
       "expect": "flatten-0035-out.jsonld"
     }, {
       "@id": "#t0036",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Flattening @index",
+      "purpose": "Flattening index maps for terms defined with @container: @index",
       "input": "flatten-0036-in.jsonld",
       "expect": "flatten-0036-out.jsonld"
     }, {
       "@id": "#t0037",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Flattening reverse properties",
+      "purpose": "Flattening @reverse keeps @reverse",
       "input": "flatten-0037-in.jsonld",
       "expect": "flatten-0037-out.jsonld"
     }, {
       "@id": "#t0038",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "Ensure all blank nodes are relabeled when flattening.",
+      "name": "Flattening blank node labels",
+      "purpose": "Blank nodes are not relabeled during expansion",
       "input": "flatten-0038-in.jsonld",
       "expect": "flatten-0038-out.jsonld"
     }, {
       "@id": "#t0039",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "Flattening reverse properties using blank nodes",
+      "name": "Using terms in a reverse-maps",
+      "purpose": "Terms within @reverse are expanded",
       "input": "flatten-0039-in.jsonld",
       "expect": "flatten-0039-out.jsonld"
     }, {
       "@id": "#t0040",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "Only invoke language and index map expansion if the value is a JSON object",
+      "name": "language and index expansion on non-objects",
+      "purpose": "Only invoke language and index map expansion if the value is a JSON object",
       "input": "flatten-0040-in.jsonld",
       "expect": "flatten-0040-out.jsonld"
     }, {
       "@id": "#t0041",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Free-floating sets and lists",
+      "purpose": "Free-floating values in sets are removed, free-floating lists are removed completely",
       "input": "flatten-0041-in.jsonld",
       "expect": "flatten-0041-out.jsonld"
     }, {
       "@id": "#t0042",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
-      "name": "Lists objects are implicit unlabeled blank nodes and thus never equivalent",
+      "name": "List objects not equivalent",
+      "purpose": "Lists objects are implicit unlabeled blank nodes and thus never equivalent",
       "input": "flatten-0042-in.jsonld",
       "expect": "flatten-0042-out.jsonld"
     }, {
       "@id": "#t0043",
       "@type": ["jld:PositiveEvaluationTest", "jld:FlattenTest"],
       "name": "Sample test manifest extract",
+      "purpose": "Flatten a test manifest",
       "input": "flatten-0043-in.jsonld",
       "expect": "flatten-0043-out.jsonld"
     }