Update frame tests, add expand test.
authorDave Longley <dlongley@digitalbazaar.com>
Wed, 28 Mar 2012 01:44:10 -0400
changeset 410 3fcb6a848078
parent 409 ff80888a52f9
child 411 991b35542ebe
Update frame tests, add expand test.
test-suite/tests/expand-0013-in.jsonld
test-suite/tests/expand-0013-out.jsonld
test-suite/tests/expand-manifest.jsonld
test-suite/tests/frame-0001-in.jsonld
test-suite/tests/frame-0001-out.jsonld
test-suite/tests/frame-0002-in.jsonld
test-suite/tests/frame-0002-out.jsonld
test-suite/tests/frame-0003-in.jsonld
test-suite/tests/frame-0003-out.jsonld
test-suite/tests/frame-0004-frame.jsonld
test-suite/tests/frame-0004-in.jsonld
test-suite/tests/frame-0004-out.jsonld
test-suite/tests/frame-0005-in.jsonld
test-suite/tests/frame-0005-out.jsonld
test-suite/tests/frame-0006-in.jsonld
test-suite/tests/frame-0006-out.jsonld
test-suite/tests/frame-0007-in.jsonld
test-suite/tests/frame-0007-out.jsonld
test-suite/tests/frame-0008-frame.jsonld
test-suite/tests/frame-0008-in.jsonld
test-suite/tests/frame-0008-out.jsonld
test-suite/tests/frame-0009-frame.jsonld
test-suite/tests/frame-0009-in.jsonld
test-suite/tests/frame-0009-out.jsonld
test-suite/tests/frame-0010-out.jsonld
test-suite/tests/frame-0011-out.jsonld
test-suite/tests/frame-0012-frame.jsonld
test-suite/tests/frame-0012-in.jsonld
test-suite/tests/frame-0013-frame.jsonld
test-suite/tests/frame-0013-in.jsonld
test-suite/tests/frame-0013-out.jsonld
test-suite/tests/frame-0014-frame.jsonld
test-suite/tests/frame-0014-in.jsonld
test-suite/tests/frame-0014-out.jsonld
test-suite/tests/frame-0015-frame.jsonld
test-suite/tests/frame-0015-out.jsonld
test-suite/tests/frame-0016-frame.jsonld
test-suite/tests/frame-0016-in.jsonld
test-suite/tests/frame-0016-out.jsonld
test-suite/tests/frame-manifest.jsonld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0013-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -0,0 +1,9 @@
+[{
+  "@id": "http://example.com/id1",
+  "@type": ["http://example.com/t1"],
+  "http://example.com/term1": ["v1"],
+  "http://example.com/term2": [{"@value": "v2", "@type": "http://example.com/t2"}],
+  "http://example.com/term3": [{"@value": "v3", "@language": "en"}],
+  "http://example.com/term4": [4],
+  "http://example.com/term5": [50, 51]
+}]
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/expand-0013-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -0,0 +1,9 @@
+[{
+  "@id": "http://example.com/id1",
+  "@type": ["http://example.com/t1"],
+  "http://example.com/term1": ["v1"],
+  "http://example.com/term2": [{"@value": "v2", "@type": "http://example.com/t2"}],
+  "http://example.com/term3": [{"@value": "v3", "@language": "en"}],
+  "http://example.com/term4": [4],
+  "http://example.com/term5": [50, 51]
+}]
\ No newline at end of file
--- a/test-suite/tests/expand-manifest.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/expand-manifest.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -64,5 +64,10 @@
     "name": "@graph with embed",
     "input": "expand-0012-in.jsonld",
     "expect": "expand-0012-out.jsonld"
+  }, {
+    "@type": ["test:TestCase", "jld:ExpandTest"],
+    "name": "expand already expanded",
+    "input": "expand-0013-in.jsonld",
+    "expect": "expand-0013-out.jsonld"
   }]
 }
\ No newline at end of file
--- a/test-suite/tests/frame-0001-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0001-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -2,12 +2,9 @@
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
     "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
+    "ex:contains": {"@type": "@id"}
   },
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/test/#library",
       "@type": "ex:Library",
--- a/test-suite/tests/frame-0001-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0001-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,4 +1,4 @@
-{
+[{
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
     "ex": "http://example.org/vocab#"
@@ -17,4 +17,4 @@
       "dc:title": "Chapter One"
     }
   }
-}
\ No newline at end of file
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0002-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0002-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -2,12 +2,9 @@
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
     "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
+    "ex:contains": {"@type": "@id"}
   },
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/test/#library",
       "@type": "ex:Library",
--- a/test-suite/tests/frame-0002-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0002-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,4 +1,4 @@
-{
+[{
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
     "ex": "http://example.org/vocab#"
@@ -18,4 +18,4 @@
       "ex:act": "ex:ActOne"
     }
   }
-}
\ No newline at end of file
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0003-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0003-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -4,10 +4,9 @@
     "ex": "http://example.org/vocab#",
     "ex:contains": {
       "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
+    }
   },
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/test/#library",
       "@type": "ex:Library",
--- a/test-suite/tests/frame-0003-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0003-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,1 +1,1 @@
-null
\ No newline at end of file
+[]
\ No newline at end of file
--- a/test-suite/tests/frame-0004-frame.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0004-frame.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -2,9 +2,7 @@
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
     "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    }
+    "ex:contains": {"@type": "@id"}
   },
   "@type": "ex:Library"
 }
\ No newline at end of file
--- a/test-suite/tests/frame-0004-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0004-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -2,11 +2,9 @@
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
     "ex": "http://example.org/vocab#",
-    "ex:contains": {
-      "@type": "@id"
-    }
+    "ex:contains": {"@type": "@id"}
   },
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/test/#library",
       "@type": "ex:Library",
--- a/test-suite/tests/frame-0004-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0004-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,7 +1,8 @@
-{
+[{
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
-    "ex": "http://example.org/vocab#"
+    "ex": "http://example.org/vocab#",
+    "ex:contains": {"@type": "@id"}
   },
   "@id": "http://example.org/test/#library",
   "@type": "ex:Library",
@@ -17,4 +18,4 @@
       "dc:title": "Chapter One"
     }
   }
-}
\ No newline at end of file
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0005-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0005-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -4,10 +4,9 @@
     "ex": "http://example.org/vocab#",
     "ex:contains": {
       "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
+    }
   },
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/test/#library",
       "@type": "ex:Library",
--- a/test-suite/tests/frame-0005-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0005-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,4 +1,4 @@
-{
+[{
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
     "ex": "http://example.org/vocab#"
@@ -16,4 +16,4 @@
       "ex:null": null
     }
   }
-}
\ No newline at end of file
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0006-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0006-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -7,7 +7,7 @@
     },
     "xsd": "http://www.w3.org/2001/XMLSchema#"
   },
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/test/#library",
       "@type": "ex:Library",
--- a/test-suite/tests/frame-0006-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0006-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,4 +1,4 @@
-{
+[{
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
     "ex": "http://example.org/vocab#"
@@ -17,4 +17,4 @@
       "dc:title": "Chapter One"
     }
   }
-}
\ No newline at end of file
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0007-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0007-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -4,10 +4,9 @@
     "ex": "http://example.org/vocab#",
     "ex:contains": {
       "@type": "@id"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
+    }
   },
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/test/#library",
       "@type": [
--- a/test-suite/tests/frame-0007-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0007-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,12 +1,12 @@
-{
+[{
   "@context": {
     "dc": "http://purl.org/dc/elements/1.1/",
     "ex": "http://example.org/vocab#"
   },
   "@id": "http://example.org/test/#library",
   "@type": [
-    "ex:Building",
-    "ex:Library"
+    "ex:Library",
+    "ex:Building"
   ],
   "ex:contains": {
     "@id": "http://example.org/test#book",
@@ -20,4 +20,4 @@
       "dc:title": "Chapter One"
     }
   }
-}
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0008-frame.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0008-frame.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,14 +1,14 @@
 {
   "@context": {
-    "ex": "http://example.org/vocab#"
+    "ex": "http://example.org/vocab#",
+    "ex:embedded": {"@container": "@set"},
+    "ex:literal": {"@container": "@set"},
+    "ex:mixed": {"@container": "@set"},
+    "ex:single": {"@container": "@set"}
   },
   "@type": "ex:Example",
-  "ex:embedded": [],
-  "ex:literal": [],
-  "ex:mixed": [
-    {
-      "@embed": false
-    }
-  ],
-  "ex:single": []
+  "ex:embedded": {},
+  "ex:literal": {},
+  "ex:mixed": {"@embed": false},
+  "ex:single": {}
 }
\ No newline at end of file
--- a/test-suite/tests/frame-0008-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0008-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -2,7 +2,7 @@
   "@context": {
     "ex": "http://example.org/vocab#"
   },
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/test/#example",
       "@type": "ex:Example",
--- a/test-suite/tests/frame-0008-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0008-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,6 +1,10 @@
-{
+[{
   "@context": {
-    "ex": "http://example.org/vocab#"
+    "ex": "http://example.org/vocab#",
+    "ex:embedded": {"@container": "@set"},
+    "ex:literal": {"@container": "@set"},
+    "ex:mixed": {"@container": "@set"},
+    "ex:single": {"@container": "@set"}
   },
   "@id": "http://example.org/test/#example",
   "@type": "ex:Example",
@@ -16,14 +20,14 @@
     "str3"
   ],
   "ex:mixed": [
-    "literal1",
-    "literal2",
     {
       "@id": "http://example.org/test#iri1"
     },
+    "literal1",
     {
       "@id": "http://example.org/test#iri2"
     },
+    "literal2",
     {
       "@id": "http://example.org/test#subject2"
     }
@@ -31,4 +35,4 @@
   "ex:single": [
     "single"
   ]
-}
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0009-frame.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0009-frame.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,6 +1,7 @@
 {
   "@context": {
-    "ex": "http://example.org/vocab#"
+    "ex": "http://example.org/vocab#",
+    "ex:p7": {"@container": "@set"}
   },
   "@type": "ex:Example1",
   "ex:p2": {
@@ -19,9 +20,5 @@
       "@default": 4
     }
   },
-  "ex:p7": [
-    {
-      "@type": "ex:Example3"
-    }
-  ]
+  "ex:p7": {"@type": "ex:Example3"}
 }
\ No newline at end of file
--- a/test-suite/tests/frame-0009-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0009-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -2,7 +2,7 @@
   "@context": {
     "ex": "http://example.org/vocab#"
   },
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/test/#example1",
       "@type": "ex:Example1",
--- a/test-suite/tests/frame-0009-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0009-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,6 +1,7 @@
-{
+[{
   "@context": {
-    "ex": "http://example.org/vocab#"
+    "ex": "http://example.org/vocab#",
+    "ex:p7": {"@container": "@set"}
   },
   "@id": "http://example.org/test/#example1",
   "@type": "ex:Example1",
@@ -14,4 +15,4 @@
     "ex:p3": 4
   },
   "ex:p7": []
-}
\ No newline at end of file
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0010-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0010-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,4 +1,4 @@
-{
+[{
   "@context": {
     "dc": "http://purl.org/dc/terms/",
     "dc:creator": {
@@ -10,4 +10,4 @@
   "@id": "http://example.com/asset",
   "@type": "ps:Asset",
   "dc:creator": null
-}
\ No newline at end of file
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0011-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0011-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,4 +1,4 @@
-{
+[{
   "@context": {
     "ex": "http://www.example.com/#"
   },
@@ -11,4 +11,4 @@
   "ex:noembed": {
     "@id": "ex:notembedded"
   }
-}
\ No newline at end of file
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-0012-frame.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0012-frame.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,11 +1,8 @@
-[
-  {
-    "@context": {
-      "sp": "http://smartplatforms.org/terms#"
-    },
-    "@type": "http://smartplatforms.org/terms#Medication"
+{
+  "@context": {
+    "sp": "http://smartplatforms.org/terms#"
   },
-  {
-    "@type": "http://smartplatforms.org/terms#Fulfillment"
-  }
-]
\ No newline at end of file
+  "@type": ["sp:Medication", "sp:Fulfillment"],
+  "sp:hasFulfillment": {"@omitDefault": true, "@embed": false},
+  "sp:hasMedication": {"@omitDefault": true, "@embed": false}
+}
\ No newline at end of file
--- a/test-suite/tests/frame-0012-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0012-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,5 +1,5 @@
 {
-  "@id": [
+  "@graph": [
     {
       "@id": "http://example.org/med-1",
       "@type": "http://smartplatforms.org/terms#Medication",
--- a/test-suite/tests/frame-0013-frame.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0013-frame.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,1 +1,5 @@
-[]
\ No newline at end of file
+{
+  "@context": {
+    "canSee": "http://example.org/vocab#canSee"
+  }
+}
\ No newline at end of file
--- a/test-suite/tests/frame-0013-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0013-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,5 +1,8 @@
 {
-  "@id": [
+  "@context": {
+    "canSee": "http://example.org/vocab#canSee"
+  },
+  "@graph": [
     {
       "@id": "looker",
       "canSee": [
--- a/test-suite/tests/frame-0013-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0013-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,8 +1,8 @@
 [
   {
-    "@id": "forgotten"
-  },
-  {
+    "@context": {
+      "canSee": "http://example.org/vocab#canSee"
+    },
     "@id": "looker",
     "canSee": [
       {
@@ -14,6 +14,15 @@
     ]
   },
   {
+    "@context": {
+      "canSee": "http://example.org/vocab#canSee"
+    },
+    "@id": "forgotten"
+  },
+  {
+    "@context": {
+      "canSee": "http://example.org/vocab#canSee"
+    },
     "@id": "spotted"
   }
 ]
\ No newline at end of file
--- a/test-suite/tests/frame-0014-frame.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0014-frame.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,7 +1,7 @@
-[
-  {
-    "@type": [
-      "Node"
-    ]
-  }
-]
\ No newline at end of file
+{
+  "@context": {
+    "sees": "http://example.org/vocab#sees",
+    "remember_me": "http://example.org/vocab#remember_me"
+  },
+  "@type": ["Node"]
+}
--- a/test-suite/tests/frame-0014-in.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0014-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,4 +1,8 @@
 {
+  "@context": {
+    "sees": "http://example.org/vocab#sees",
+    "remember_me": "http://example.org/vocab#remember_me"
+  },
   "@id": "a",
   "@type": "Node",
   "sees": {
--- a/test-suite/tests/frame-0014-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0014-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,5 +1,9 @@
 [
   {
+    "@context": {
+      "sees": "http://example.org/vocab#sees",
+      "remember_me": "http://example.org/vocab#remember_me"
+    },
     "@id": "a",
     "@type": "Node",
     "sees": {
@@ -7,10 +11,13 @@
     }
   },
   {
+    "@context": {
+      "sees": "http://example.org/vocab#sees",
+      "remember_me": "http://example.org/vocab#remember_me"
+    },
     "@id": "b",
     "@type": "Node",
     "sees": {
-      "@id": "_:c14n0",
       "remember_me": "This value should not disappear."
     }
   }
--- a/test-suite/tests/frame-0015-frame.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0015-frame.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,227 +1,93 @@
-[
-  {
-    "@context": {
-      "api": "http://smartplatforms.org/terms/api#",
-      "dcterms": "http://purl.org/dc/terms/",
-      "foaf": "http://xmlns.com/foaf/0.1/",
-      "owl": "http://www.w3.org/2002/07/owl#",
-      "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
-      "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
-      "sp": "http://smartplatforms.org/terms#",
-      "sp:abnormalInterpretation": {
-        "@type": "@id"
-      },
-      "sp:address": {
-        "@type": "@id"
-      },
-      "sp:alertLevel": {
-        "@type": "@id"
-      },
-      "sp:allergicReaction": {
-        "@type": "@id"
-      },
-      "sp:allergyExclusionName": {
-        "@type": "@id"
-      },
-      "sp:belongsTo": {
-        "@type": "@id"
-      },
-      "sp:bloodPressure": {
-        "@type": "@id"
-      },
-      "sp:bodyMassIndex": {
-        "@type": "@id"
-      },
-      "sp:bodyPosition": {
-        "@type": "@id"
-      },
-      "sp:bodySite": {
-        "@type": "@id"
-      },
-      "sp:category": {
-        "@type": "@id"
-      },
-      "sp:code": {
-        "@type": "@id"
-      },
-      "sp:created": {
-        "@type": "@id"
-      },
-      "sp:denominator": {
-        "@type": "@id"
-      },
-      "sp:diastolic": {
-        "@type": "@id"
-      },
-      "sp:drugAllergen": {
-        "@type": "@id"
-      },
-      "sp:drugClass": {
-        "@type": "@id"
-      },
-      "sp:drugClassAllergen": {
-        "@type": "@id"
-      },
-      "sp:drugName": {
-        "@type": "@id"
-      },
-      "sp:encounter": {
-        "@type": "@id"
-      },
-      "sp:encounterType": {
-        "@type": "@id"
-      },
-      "sp:facility": {
-        "@type": "@id"
-      },
-      "sp:foodAllergen": {
-        "@type": "@id"
-      },
-      "sp:frequency": {
-        "@type": "@id"
-      },
-      "sp:fulfillment": {
-        "@type": "@id"
-      },
-      "sp:hasStatement": {
-        "@type": "@id"
-      },
-      "sp:heartRate": {
-        "@type": "@id"
-      },
-      "sp:height": {
-        "@type": "@id"
-      },
-      "sp:labName": {
-        "@type": "@id"
-      },
-      "sp:labResult": {
-        "@type": "@id"
-      },
-      "sp:labSpecimenCollected": {
-        "@type": "@id"
-      },
-      "sp:labStatus": {
-        "@type": "@id"
-      },
-      "sp:maximum": {
-        "@type": "@id"
-      },
-      "sp:medicalRecordNumber": {
-        "@type": "@id"
-      },
-      "sp:medication": {
-        "@type": "@id"
-      },
-      "sp:method": {
-        "@type": "@id"
-      },
-      "sp:minimum": {
-        "@type": "@id"
-      },
-      "sp:narrativeResult": {
-        "@type": "@id"
-      },
-      "sp:nominalResult": {
-        "@type": "@id"
-      },
-      "sp:nonCriticalRange": {
-        "@type": "@id"
-      },
-      "sp:normalRange": {
-        "@type": "@id"
-      },
-      "sp:numerator": {
-        "@type": "@id"
-      },
-      "sp:ordinalResult": {
-        "@type": "@id"
-      },
-      "sp:organization": {
-        "@type": "@id"
-      },
-      "sp:oxygenSaturation": {
-        "@type": "@id"
-      },
-      "sp:participant": {
-        "@type": "@id"
-      },
-      "sp:person": {
-        "@type": "@id"
-      },
-      "sp:pharmacy": {
-        "@type": "@id"
-      },
-      "sp:problemName": {
-        "@type": "@id"
-      },
-      "sp:provenance": {
-        "@type": "@id"
-      },
-      "sp:provider": {
-        "@type": "@id"
-      },
-      "sp:quantitativeResult": {
-        "@type": "@id"
-      },
-      "sp:quantity": {
-        "@type": "@id"
-      },
-      "sp:quantityDispensed": {
-        "@type": "@id"
-      },
-      "sp:respiratoryRate": {
-        "@type": "@id"
-      },
-      "sp:severity": {
-        "@type": "@id"
-      },
-      "sp:specimenCollected": {
-        "@type": "@id"
-      },
-      "sp:systolic": {
-        "@type": "@id"
-      },
-      "sp:temperature": {
-        "@type": "@id"
-      },
-      "sp:translationFidelity": {
-        "@type": "@id"
-      },
-      "sp:valueAndUnit": {
-        "@type": "@id"
-      },
-      "sp:vitalName": {
-        "@type": "@id"
-      },
-      "sp:weight": {
-        "@type": "@id"
-      },
-      "spcode": "http://smartplatforms.org/terms/codes/",
-      "vcard": "http://www.w3.org/2006/vcard/ns#",
-      "vcard:adr": {
-        "@type": "@id"
-      },
-      "vcard:n": {
-        "@type": "@id"
-      },
-      "vcard:tel": {
-        "@type": "@id"
-      }
-    },
-    "@type": [
-      "http://smartplatforms.org/terms#Statement",
-      "http://smartplatforms.org/terms#Fulfillment",
-      "http://smartplatforms.org/terms#Alert",
-      "http://smartplatforms.org/terms#AllergyExclusion",
-      "http://smartplatforms.org/terms#Demographics",
-      "http://smartplatforms.org/terms#Problem",
-      "http://smartplatforms.org/terms#Medication",
-      "http://smartplatforms.org/terms#VitalSigns",
-      "http://smartplatforms.org/terms#MedicalRecord",
-      "http://smartplatforms.org/terms#LabResult",
-      "http://smartplatforms.org/terms#Allergy",
-      "http://smartplatforms.org/terms#Encounter"
-    ]
-  }
-]
\ No newline at end of file
+{
+  "@context": {
+    "api": "http://smartplatforms.org/terms/api#",
+    "dcterms": "http://purl.org/dc/terms/",
+    "foaf": "http://xmlns.com/foaf/0.1/",
+    "owl": "http://www.w3.org/2002/07/owl#",
+    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
+    "sp": "http://smartplatforms.org/terms#",
+    "sp:abnormalInterpretation": {"@type": "@id"},
+    "sp:address": {"@type": "@id"},
+    "sp:alertLevel": {"@type": "@id"},
+    "sp:allergicReaction": {"@type": "@id"},
+    "sp:allergyExclusionName": {"@type": "@id"},
+    "sp:belongsTo": {"@type": "@id"},
+    "sp:bloodPressure": {"@type": "@id"},
+    "sp:bodyMassIndex": {"@type": "@id"},
+    "sp:bodyPosition": {"@type": "@id"},
+    "sp:bodySite": {"@type": "@id"},
+    "sp:category": {"@type": "@id"},
+    "sp:code": {"@type": "@id"},
+    "sp:created": {"@type": "@id"},
+    "sp:denominator": {"@type": "@id"},
+    "sp:diastolic": {"@type": "@id"},
+    "sp:drugAllergen": {"@type": "@id"},
+    "sp:drugClass": {"@type": "@id"},
+    "sp:drugClassAllergen": {"@type": "@id"},
+    "sp:drugName": {"@type": "@id"},
+    "sp:encounter": {"@type": "@id"},
+    "sp:encounterType": {"@type": "@id"},
+    "sp:facility": {"@type": "@id"},
+    "sp:foodAllergen": {"@type": "@id"},
+    "sp:frequency": {"@type": "@id"},
+    "sp:fulfillment": {"@type": "@id"},
+    "sp:hasStatement": {"@type": "@id"},
+    "sp:heartRate": {"@type": "@id"},
+    "sp:height": {"@type": "@id"},
+    "sp:labName": {"@type": "@id"},
+    "sp:labResult": {"@type": "@id"},
+    "sp:labSpecimenCollected": {"@type": "@id"},
+    "sp:labStatus": {"@type": "@id"},
+    "sp:maximum": {"@type": "@id"},
+    "sp:medicalRecordNumber": {"@type": "@id"},
+    "sp:medication": {"@type": "@id"},
+    "sp:method": {"@type": "@id"},
+    "sp:minimum": {"@type": "@id"},
+    "sp:narrativeResult": {"@type": "@id"},
+    "sp:nominalResult": {"@type": "@id"},
+    "sp:nonCriticalRange": {"@type": "@id"},
+    "sp:normalRange": {"@type": "@id"},
+    "sp:numerator": {"@type": "@id"},
+    "sp:ordinalResult": {"@type": "@id"},
+    "sp:organization": {"@type": "@id"},
+    "sp:oxygenSaturation": {"@type": "@id"},
+    "sp:participant": {"@type": "@id"},
+    "sp:person": {"@type": "@id"},
+    "sp:pharmacy": {"@type": "@id"},
+    "sp:problemName": {"@type": "@id"},
+    "sp:provenance": {"@type": "@id"},
+    "sp:provider": {"@type": "@id"},
+    "sp:quantitativeResult": {"@type": "@id"},
+    "sp:quantity": {"@type": "@id"},
+    "sp:quantityDispensed": {"@type": "@id"},
+    "sp:respiratoryRate": {"@type": "@id"},
+    "sp:severity": {"@type": "@id"},
+    "sp:specimenCollected": {"@type": "@id"},
+    "sp:systolic": {"@type": "@id"},
+    "sp:temperature": {"@type": "@id"},
+    "sp:translationFidelity": {"@type": "@id"},
+    "sp:valueAndUnit": {"@type": "@id"},
+    "sp:vitalName": {"@type": "@id"},
+    "sp:weight": {"@type": "@id"},
+    "spcode": "http://smartplatforms.org/terms/codes/",
+    "vcard": "http://www.w3.org/2006/vcard/ns#",
+    "vcard:adr": {"@type": "@id"},
+    "vcard:n": {"@type": "@id"},
+    "vcard:tel": {"@type": "@id"}
+  },
+  "@type": [
+    "sp:Statement",
+    "sp:Fulfillment",
+    "sp:Alert",
+    "sp:AllergyExclusion",
+    "sp:Demographics",
+    "sp:Problem",
+    "sp:Medication",
+    "sp:VitalSigns",
+    "sp:MedicalRecord",
+    "sp:LabResult",
+    "sp:Allergy",
+    "sp:Encounter"
+  ]
+}
\ No newline at end of file
--- a/test-suite/tests/frame-0015-out.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-0015-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -1,10 +1,81 @@
 [
   {
     "@context": {
+      "api": "http://smartplatforms.org/terms/api#",
+      "dcterms": "http://purl.org/dc/terms/",
+      "foaf": "http://xmlns.com/foaf/0.1/",
+      "owl": "http://www.w3.org/2002/07/owl#",
+      "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+      "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
       "sp": "http://smartplatforms.org/terms#",
-      "sp:hasStatement": {
-        "@type": "@id"
-      }
+      "sp:abnormalInterpretation": {"@type": "@id"},
+      "sp:address": {"@type": "@id"},
+      "sp:alertLevel": {"@type": "@id"},
+      "sp:allergicReaction": {"@type": "@id"},
+      "sp:allergyExclusionName": {"@type": "@id"},
+      "sp:belongsTo": {"@type": "@id"},
+      "sp:bloodPressure": {"@type": "@id"},
+      "sp:bodyMassIndex": {"@type": "@id"},
+      "sp:bodyPosition": {"@type": "@id"},
+      "sp:bodySite": {"@type": "@id"},
+      "sp:category": {"@type": "@id"},
+      "sp:code": {"@type": "@id"},
+      "sp:created": {"@type": "@id"},
+      "sp:denominator": {"@type": "@id"},
+      "sp:diastolic": {"@type": "@id"},
+      "sp:drugAllergen": {"@type": "@id"},
+      "sp:drugClass": {"@type": "@id"},
+      "sp:drugClassAllergen": {"@type": "@id"},
+      "sp:drugName": {"@type": "@id"},
+      "sp:encounter": {"@type": "@id"},
+      "sp:encounterType": {"@type": "@id"},
+      "sp:facility": {"@type": "@id"},
+      "sp:foodAllergen": {"@type": "@id"},
+      "sp:frequency": {"@type": "@id"},
+      "sp:fulfillment": {"@type": "@id"},
+      "sp:hasStatement": {"@type": "@id"},
+      "sp:heartRate": {"@type": "@id"},
+      "sp:height": {"@type": "@id"},
+      "sp:labName": {"@type": "@id"},
+      "sp:labResult": {"@type": "@id"},
+      "sp:labSpecimenCollected": {"@type": "@id"},
+      "sp:labStatus": {"@type": "@id"},
+      "sp:maximum": {"@type": "@id"},
+      "sp:medicalRecordNumber": {"@type": "@id"},
+      "sp:medication": {"@type": "@id"},
+      "sp:method": {"@type": "@id"},
+      "sp:minimum": {"@type": "@id"},
+      "sp:narrativeResult": {"@type": "@id"},
+      "sp:nominalResult": {"@type": "@id"},
+      "sp:nonCriticalRange": {"@type": "@id"},
+      "sp:normalRange": {"@type": "@id"},
+      "sp:numerator": {"@type": "@id"},
+      "sp:ordinalResult": {"@type": "@id"},
+      "sp:organization": {"@type": "@id"},
+      "sp:oxygenSaturation": {"@type": "@id"},
+      "sp:participant": {"@type": "@id"},
+      "sp:person": {"@type": "@id"},
+      "sp:pharmacy": {"@type": "@id"},
+      "sp:problemName": {"@type": "@id"},
+      "sp:provenance": {"@type": "@id"},
+      "sp:provider": {"@type": "@id"},
+      "sp:quantitativeResult": {"@type": "@id"},
+      "sp:quantity": {"@type": "@id"},
+      "sp:quantityDispensed": {"@type": "@id"},
+      "sp:respiratoryRate": {"@type": "@id"},
+      "sp:severity": {"@type": "@id"},
+      "sp:specimenCollected": {"@type": "@id"},
+      "sp:systolic": {"@type": "@id"},
+      "sp:temperature": {"@type": "@id"},
+      "sp:translationFidelity": {"@type": "@id"},
+      "sp:valueAndUnit": {"@type": "@id"},
+      "sp:vitalName": {"@type": "@id"},
+      "sp:weight": {"@type": "@id"},
+      "spcode": "http://smartplatforms.org/terms/codes/",
+      "vcard": "http://www.w3.org/2006/vcard/ns#",
+      "vcard:adr": {"@type": "@id"},
+      "vcard:n": {"@type": "@id"},
+      "vcard:tel": {"@type": "@id"}    
     },
     "@id": "http://localhost:7000/records/999888",
     "@type": "sp:MedicalRecord",
@@ -12,31 +83,100 @@
   },
   {
     "@context": {
+      "api": "http://smartplatforms.org/terms/api#",
       "dcterms": "http://purl.org/dc/terms/",
+      "foaf": "http://xmlns.com/foaf/0.1/",
+      "owl": "http://www.w3.org/2002/07/owl#",
+      "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+      "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
       "sp": "http://smartplatforms.org/terms#",
-      "sp:belongsTo": {
-        "@type": "@id"
-      },
-      "sp:code": {
-        "@type": "@id"
-      }
+      "sp:abnormalInterpretation": {"@type": "@id"},
+      "sp:address": {"@type": "@id"},
+      "sp:alertLevel": {"@type": "@id"},
+      "sp:allergicReaction": {"@type": "@id"},
+      "sp:allergyExclusionName": {"@type": "@id"},
+      "sp:belongsTo": {"@type": "@id"},
+      "sp:bloodPressure": {"@type": "@id"},
+      "sp:bodyMassIndex": {"@type": "@id"},
+      "sp:bodyPosition": {"@type": "@id"},
+      "sp:bodySite": {"@type": "@id"},
+      "sp:category": {"@type": "@id"},
+      "sp:code": {"@type": "@id"},
+      "sp:created": {"@type": "@id"},
+      "sp:denominator": {"@type": "@id"},
+      "sp:diastolic": {"@type": "@id"},
+      "sp:drugAllergen": {"@type": "@id"},
+      "sp:drugClass": {"@type": "@id"},
+      "sp:drugClassAllergen": {"@type": "@id"},
+      "sp:drugName": {"@type": "@id"},
+      "sp:encounter": {"@type": "@id"},
+      "sp:encounterType": {"@type": "@id"},
+      "sp:facility": {"@type": "@id"},
+      "sp:foodAllergen": {"@type": "@id"},
+      "sp:frequency": {"@type": "@id"},
+      "sp:fulfillment": {"@type": "@id"},
+      "sp:hasStatement": {"@type": "@id"},
+      "sp:heartRate": {"@type": "@id"},
+      "sp:height": {"@type": "@id"},
+      "sp:labName": {"@type": "@id"},
+      "sp:labResult": {"@type": "@id"},
+      "sp:labSpecimenCollected": {"@type": "@id"},
+      "sp:labStatus": {"@type": "@id"},
+      "sp:maximum": {"@type": "@id"},
+      "sp:medicalRecordNumber": {"@type": "@id"},
+      "sp:medication": {"@type": "@id"},
+      "sp:method": {"@type": "@id"},
+      "sp:minimum": {"@type": "@id"},
+      "sp:narrativeResult": {"@type": "@id"},
+      "sp:nominalResult": {"@type": "@id"},
+      "sp:nonCriticalRange": {"@type": "@id"},
+      "sp:normalRange": {"@type": "@id"},
+      "sp:numerator": {"@type": "@id"},
+      "sp:ordinalResult": {"@type": "@id"},
+      "sp:organization": {"@type": "@id"},
+      "sp:oxygenSaturation": {"@type": "@id"},
+      "sp:participant": {"@type": "@id"},
+      "sp:person": {"@type": "@id"},
+      "sp:pharmacy": {"@type": "@id"},
+      "sp:problemName": {"@type": "@id"},
+      "sp:provenance": {"@type": "@id"},
+      "sp:provider": {"@type": "@id"},
+      "sp:quantitativeResult": {"@type": "@id"},
+      "sp:quantity": {"@type": "@id"},
+      "sp:quantityDispensed": {"@type": "@id"},
+      "sp:respiratoryRate": {"@type": "@id"},
+      "sp:severity": {"@type": "@id"},
+      "sp:specimenCollected": {"@type": "@id"},
+      "sp:systolic": {"@type": "@id"},
+      "sp:temperature": {"@type": "@id"},
+      "sp:translationFidelity": {"@type": "@id"},
+      "sp:valueAndUnit": {"@type": "@id"},
+      "sp:vitalName": {"@type": "@id"},
+      "sp:weight": {"@type": "@id"},
+      "spcode": "http://smartplatforms.org/terms/codes/",
+      "vcard": "http://www.w3.org/2006/vcard/ns#",
+      "vcard:adr": {"@type": "@id"},
+      "vcard:n": {"@type": "@id"},
+      "vcard:tel": {"@type": "@id"}  
     },
     "@id": "http://localhost:7000/records/999888/vital_signs/c9ddca3e-3df8-4f13-9a16-eecd80aa8ff6",
     "@type": "sp:VitalSigns",
     "sp:belongsTo": "http://localhost:7000/records/999888",
     "sp:bloodPressure": {
-      "@id": "_:c14n0",
+      "@id": "_:t2",
       "@type": "sp:BloodPressure",
       "sp:systolic": {
-        "@id": "_:c14n2",
+        "@id": "_:t0",
         "@type": "sp:VitalSign",
         "sp:unit": "mm[Hg]",
         "sp:value": "111.226458141",
         "sp:vitalName": {
-          "@id": "_:c14n1",
+          "@id": "_:t1",
           "@type": "sp:CodedValue",
           "dcterms:title": "Systolic blood pressure",
-          "sp:code": "http://loinc.org/codes/8480-6"
+          "sp:code": {
+            "@id": "http://loinc.org/codes/8480-6"
+          }
         }
       }
     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/frame-0016-frame.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -0,0 +1,8 @@
+{
+  "@context": {
+    "dc": "http://purl.org/dc/elements/1.1/",
+    "ex": "http://example.org/vocab#"
+  },
+  "@type": {},
+  "ex:contains": {}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/frame-0016-in.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -0,0 +1,19 @@
+{
+  "@context": {
+    "dc": "http://purl.org/dc/elements/1.1/",
+    "ex": "http://example.org/vocab#",
+    "ex:contains": {"@type": "@id"}
+  },
+  "@graph": [
+    {
+      "@id": "http://example.org/test/#library",
+      "@type": "ex:Library",
+      "ex:contains": "http://example.org/test#untyped"
+    },
+    {
+      "@id": "http://example.org/test#untyped",
+      "dc:contributor": "Writer",
+      "dc:title": "My Book"
+    }
+  ]
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/frame-0016-out.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -0,0 +1,13 @@
+[{
+  "@context": {
+    "dc": "http://purl.org/dc/elements/1.1/",
+    "ex": "http://example.org/vocab#"
+  },
+  "@id": "http://example.org/test/#library",
+  "@type": "ex:Library",
+  "ex:contains": {
+    "@id": "http://example.org/test#untyped",
+    "dc:contributor": "Writer",
+    "dc:title": "My Book"
+  }
+}]
\ No newline at end of file
--- a/test-suite/tests/frame-manifest.jsonld	Sun Mar 25 16:27:28 2012 -0400
+++ b/test-suite/tests/frame-manifest.jsonld	Wed Mar 28 01:44:10 2012 -0400
@@ -94,5 +94,11 @@
       "input": "frame-0015-in.jsonld",
       "frame": "frame-0015-frame.jsonld",
       "expect": "frame-0015-out.jsonld"
+   }, {
+      "@type": ["test:TestCase", "jld:FrameTest"],
+      "name": "Use @type in ducktype filter",
+      "input": "frame-0016-in.jsonld",
+      "frame": "frame-0016-frame.jsonld",
+      "expect": "frame-0016-out.jsonld"
    }]
 }