Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated JSONConstructor and PROV-JSON schema to WD4. Named bundles ar…

…e not supported yet.
  • Loading branch information...
commit c79581c384a53b58ec48cd07fff327cd808def07 1 parent f527a0c
@trungdong trungdong authored
View
200 json/schema/prov-json-schema.js
@@ -36,86 +36,97 @@
"additionalProperties":{}
}
},
- "agent":{
- "type":"array",
- "description":"List of ids of entities that are assert as agents",
- "items":{
- "type":"string",
- "format": "uri"
+ "wasGeneratedBy": {
+ "type":"object",
+ "additionalProperties":{
+ "type":"object",
+ "properties":{
+ "prov:entity": {"type": "string", "format": "uri", "required":true},
+ "prov:activity": {"type": "string", "format": "uri", "required":true},
+ "prov:time": {"type": "string", "format": "date-time"}
+ },
+ "additionalProperties":{}
}
},
- "note":{
+ "used": {"$ref":"#/properties/wasGeneratedBy"},
+ "wasStartedBy": {
"type":"object",
- "description":"Map of notes by ids",
"additionalProperties":{
"type":"object",
- "title":"note",
+ "properties":{
+ "prov:activity": {"type": "string", "format": "uri", "required":true},
+ "prov:trigger": {"type": "string", "format": "uri", "required":false},
+ "prov:time": {"type": "string", "format": "date-time"}
+ },
"additionalProperties":{}
}
},
- "account": {
+ "wasEndedBy": {"$ref":"#/properties/wasStartedBy"},
+ "wasInvalidatedBy": {
"type":"object",
- "description":"Map of accounts by ids",
- "additionalProperties": {
+ "additionalProperties":{
"type":"object",
- "title":"account",
"properties":{
- "asserter": {"type": "string", "format": "uri", "required": true},
- "entity":{"$ref":"#/properties/entity"},
- "activity":{"$ref":"#/properties/activity"},
- "agent":{"$ref":"#/properties/agent"},
- "note":{"$ref":"#/properties/note"},
- "wasGeneratedBy":{"$ref":"#/properties/wasGeneratedBy"},
- "used":{"$ref":"#/properties/used"},
- "wasAssociatedWith":{"$ref":"#/properties/wasAssociatedWith"},
- "wasStartedBy":{"$ref":"#/properties/wasStartedBy"},
- "wasEndedby":{"$ref":"#/properties/wasEndedby"},
- "actedOnBehalfOf":{"$ref":"#/properties/actedOnBehalfOf"},
- "wasDerivedFrom":{"$ref":"#/properties/wasDerivedFrom"},
- "alternateOf":{"$ref":"#/properties/alternateOf"},
- "specializationOf":{"$ref":"#/properties/specializationOf"},
- "hasAnnotation":{"$ref":"#/properties/hasAnnotation"}
+ "prov:started": {"type": "string", "format": "uri", "required":true},
+ "prov:starter": {"type": "string", "format": "uri", "required":true},
},
- "additionalProperties": false
+ "additionalProperties":{}
}
},
- "wasGeneratedBy": {
+ "wasInformedBy": {
"type":"object",
"additionalProperties":{
"type":"object",
"properties":{
- "prov:entity": {"type": "string", "format": "uri", "required":true},
- "prov:activity": {"type": "string", "format": "uri", "required":true},
- "prov:time": {"type": "string", "format": "date-time"}
+ "prov:informed": {"type": "string", "format": "uri", "required":true},
+ "prov:informant": {"type": "string", "format": "uri", "required":true},
},
"additionalProperties":{}
}
},
- "used": {"$ref":"#/properties/wasGeneratedBy"},
- "wasAssociatedWith": {
+ "wasStartedByActivity": {
"type":"object",
"additionalProperties":{
"type":"object",
"properties":{
- "prov:activity": {"type": "string", "format": "uri", "required":true},
+ "prov:informed": {"type": "string", "format": "uri", "required":true},
+ "prov:informant": {"type": "string", "format": "uri", "required":true},
+ },
+ "additionalProperties":{}
+ }
+ },
+ "agent":{
+ "type":"object",
+ "description":"Map of ids of agents",
+ "additionalProperties":{
+ "type":"object",
+ "title":"entity",
+ "additionalProperties":{}
+ }
+ },
+ "wasAttributedTo": {
+ "type":"object",
+ "additionalProperties":{
+ "type":"object",
+ "properties":{
+ "prov:entity": {"type": "string", "format": "uri", "required":true},
"prov:agent": {"type": "string", "format": "uri", "required":true},
- "prov:plan": {"type": "string", "format": "uri", "required":false}
},
"additionalProperties":{}
}
},
- "wasStartedBy": {
+ "wasAssociatedWith": {
"type":"object",
"additionalProperties":{
"type":"object",
"properties":{
"prov:activity": {"type": "string", "format": "uri", "required":true},
- "prov:agent": {"type": "string", "format": "uri", "required":true}
+ "prov:agent": {"type": "string", "format": "uri", "required":true},
+ "prov:plan": {"type": "string", "format": "uri", "required":false}
},
"additionalProperties":{}
}
},
- "wasEndedby": {"$ref":"#/properties/wasStartedBy"},
"actedOnBehalfOf": {
"type":"object",
"additionalProperties":{
@@ -140,23 +151,54 @@
"prov:generation": {"type": "string", "format": "uri"},
"prov:usage": {"type": "string", "format": "uri"}
},
- "additionalProperties":{},
- "dependencies": {
- "prov:activity": ["prov:generation", "prov:usage"],
- "prov:generation": ["prov:activity", "prov:usage"],
- "prov:usage": ["prov:activity", "prov:generation"]
- }
+ "additionalProperties":{}
}
},
- "alternateOf": {
+ "wasRevisionOf": {
+ "type":"object",
+ "additionalProperties":{
+ "type":"object",
+ "properties":{
+ "prov:newer": {"type": "string", "format": "uri", "required":true},
+ "prov:older": {"type": "string", "format": "uri", "required":true},
+ "prov:responsibility": {"type": "string", "format": "uri"}
+ },
+ "additionalProperties":{}
+ }
+ },
+ "wasQuotedFrom": {
+ "type":"object",
+ "additionalProperties":{
+ "type":"object",
+ "properties":{
+ "prov:quote": {"type": "string", "format": "uri", "required":true},
+ "prov:original": {"type": "string", "format": "uri", "required":true},
+ "prov:quoterAgent": {"type": "string", "format": "uri"},
+ "prov:originalAgent": {"type": "string", "format": "uri"}
+ },
+ "additionalProperties":{}
+ }
+ },
+ "hadOriginalSource": {
+ "type":"object",
+ "additionalProperties":{
+ "type":"object",
+ "properties":{
+ "prov:derived": {"type": "string", "format": "uri", "required":true},
+ "prov:source": {"type": "string", "format": "uri", "required":true}
+ },
+ "additionalProperties":{}
+ }
+ },
+ "tracedTo": {
"type":"object",
"additionalProperties":{
"type":"object",
"properties":{
"prov:entity": {"type": "string", "format": "uri", "required":true},
- "prov:alternate": {"type": "string", "format": "uri", "required":true}
+ "prov:ancestor": {"type": "string", "format": "uri", "required":true}
},
- "additionalProperties": {}
+ "additionalProperties":{}
}
},
"specializationOf": {
@@ -164,12 +206,68 @@
"additionalProperties":{
"type":"object",
"properties":{
- "prov:entity": {"type": "string", "format": "uri", "required":true},
- "prov:specialization": {"type": "string", "format": "uri", "required":true}
+ "prov:specializedEntity": {"type": "string", "format": "uri", "required":true},
+ "prov:generalEntity": {"type": "string", "format": "uri", "required":true}
+ },
+ "additionalProperties": {}
+ }
+ },
+ "alternateOf": {
+ "type":"object",
+ "additionalProperties":{
+ "type":"object",
+ "properties":{
+ "prov:alternate1": {"type": "string", "format": "uri", "required":true},
+ "prov:alternate2": {"type": "string", "format": "uri", "required":true}
+ },
+ "additionalProperties": {}
+ }
+ },
+ "derivedByInsertionFrom": {
+ "type":"object",
+ "additionalProperties":{
+ "type":"object",
+ "properties":{
+ "prov:after": {"type": "string", "format": "uri", "required":true},
+ "prov:before": {"type": "string", "format": "uri", "required":true},
+ "prov:key-entity-set": {"type": "array", "items":{}, "required":true}
+ },
+ "additionalProperties":{}
+ }
+ },
+ "derivedByRemovalFrom": {
+ "type":"object",
+ "additionalProperties":{
+ "type":"object",
+ "properties":{
+ "prov:after": {"type": "string", "format": "uri", "required":true},
+ "prov:before": {"type": "string", "format": "uri", "required":true},
+ "prov:key-set": {"type": "array", "items":{}, "required":true}
},
"additionalProperties": {}
}
},
+ "memberOf": {
+ "type":"object",
+ "additionalProperties":{
+ "type":"object",
+ "properties":{
+ "prov:after": {"type": "string", "format": "uri", "required":true},
+ "prov:key-entity-set": {"type": "array", "items":{}, "required":true},
+ "prov:complete": {"type": "boolean", "required":false}
+ },
+ "additionalProperties": {}
+ }
+ },
+ "note":{
+ "type":"object",
+ "description":"Map of notes by ids",
+ "additionalProperties":{
+ "type":"object",
+ "title":"note",
+ "additionalProperties":{}
+ }
+ },
"hasAnnotation": {
"type":"object",
"additionalProperties":{
View
66 json/src/main/java/org/openprovenance/prov/json/JSONConstructor.java
@@ -431,38 +431,74 @@ public Object convertSpecializationOf(Object id2, Object id1) {
/* Component 5 */
public Object convertInsertion(Object id, Object id2, Object id1, Object map, Object dAttrs) {
- //todo
- throw new UnsupportedOperationException();
+ List<Object> attrs = new ArrayList<Object>();
+ attrs.add(tuple("prov:after", id2));
+ attrs.add(tuple("prov:before", id1));
+ attrs.add(tuple("prov:key-entity-set", map));
+ if (dAttrs != null) {
+ attrs.addAll((List<Object>)dAttrs);
+ }
+
+ if (id == null)
+ id = getBlankID("dBIF");
+
+ return new ProvRecord("derivedByInsertionFrom", id, attrs);
}
public Object convertEntry(Object o1, Object o2) {
- //todo
- throw new UnsupportedOperationException();
+ return tuple(o1, o2);
}
public Object convertKeyEntitySet(List<Object> o) {
- //todo
- throw new UnsupportedOperationException();
+ return o;
}
public Object convertRemoval(Object id, Object id2, Object id1, Object keys, Object dAttrs) {
- //todo
- throw new UnsupportedOperationException();
+ List<Object> attrs = new ArrayList<Object>();
+ attrs.add(tuple("prov:after", id2));
+ attrs.add(tuple("prov:before", id1));
+ attrs.add(tuple("prov:key-set", keys));
+ if (dAttrs != null) {
+ attrs.addAll((List<Object>)dAttrs);
+ }
+
+ if (id == null)
+ id = getBlankID("dBIF");
+
+ return new ProvRecord("derivedByRemovalFrom", id, attrs);
}
public Object convertMembership(Object id, Object id2, Object keys, Object dAttrs) {
- //todo
- throw new UnsupportedOperationException();
+ List<Object> attrs = new ArrayList<Object>();
+ attrs.add(tuple("prov:after", id2));
+ attrs.add(tuple("prov:key-entity-set", keys));
+ if (dAttrs != null) {
+ attrs.addAll((List<Object>)dAttrs);
+ }
+
+ if (id == null)
+ id = getBlankID("mO");
+
+ return new ProvRecord("memberOf", id, attrs);
}
public Object convertKeys(List<Object> keys) {
- //todo
- throw new UnsupportedOperationException();
+ return keys;
}
public Object convertMemberOf(Object id, Object id2, Object map, Object complete, Object dAttrs) {
- //todo
- throw new UnsupportedOperationException();
+ List<Object> attrs = new ArrayList<Object>();
+ attrs.add(tuple("prov:after", id2));
+ attrs.add(tuple("prov:key-entity-set", map));
+ attrs.add(tuple("prov:complete", complete));
+ if (dAttrs != null) {
+ attrs.addAll((List<Object>)dAttrs);
+ }
+
+ if (id == null)
+ id = getBlankID("mO");
+
+ return new ProvRecord("memberOf", id, attrs);
}
/* Component 6 */
@@ -479,7 +515,7 @@ public Object convertHasAnnotation(Object something, Object note) {
}
- /* Other conversions */
+ /* Other conversions */
public Object convertBundle(Object nss, List<Object> records, List<Object> bundles) {
Map<String,Object> bundle = new HashMap<String, Object>();
bundle.put("prefix", nss);
Please sign in to comment.
Something went wrong with that request. Please try again.