private void initAssertionsMap() { assertions = JSCollections.$map(); for (int i = 0; i < inputGraph.getNodes().$length();i++) { assertions.$put(String.valueOf(i),new Array<PapAssertion>()); } }
public EcFramework() { Map<String, Object> me = JSObjectAdapter.$properties(this); if (template != null) { Map<String, Object> you = JSObjectAdapter.$properties(template); for (String key : you) { if (JSGlobal.typeof(you.$get(key)) != "function") me.$put(key.replace("@", ""), you.$get(key)); } } }
@Override protected void upgrade() { super.upgrade(); if (TYPE_0_1.equals(type)) { Map<String, Object> me = JSObjectAdapter.$properties(this); // Error in older versions of LD objects: We used @schema instead of // @context. Whoops. if (me.$get("@context") == null && me.$get("@schema") != null) me.$put("@context", me.$get("@schema")); setContextAndType(General.context_0_2, TYPE_0_2); } }
private void addRelationToCompetencyMap(String competencyId, EcAlignment relation) { Array<EcAlignment> competencyRelations; competencyRelations = getRelationsForCompetency(competencyId); competencyRelations.push(relation); frameworkRelationMap.$put(competencyId, competencyRelations); }
private Array<EcAlignment> getRelationsForCompetency(String competencyId) { Array<EcAlignment> competencyRelations = frameworkRelationMap.$get(competencyId); if (competencyRelations == null) { competencyRelations = new Array<EcAlignment>(); frameworkRelationMap.$put(competencyId, competencyRelations); } return competencyRelations; }
public void addNode(Node n) { if (nodeMap.$get(n.getId()) == null) { nodeList.push(n); nodeMap.$put(n.getId(),n); } }
public void asRdfXml(Callback1<String> success, Callback1<String> failure, String signatureSheet) { final FormData fd = new FormData(); final String id = this.id; if (signatureSheet != null || signatureSheet != JSGlobal.undefined) fd.append("signatureSheet", signatureSheet); Map<String, String> headers = JSCollections.$map(); headers.$put("Accept", "application/rdf+xml"); EcRemote.postWithHeadersExpectingString(id, "", fd, headers, success, failure); }
@Template("map") public static <K extends String, V> Map<K, V> $map(K k1, V v1) { Map<K, V> m = new Map<K, V>(); m.$put(k1, v1); return m; }
@Override public void $invoke(String s) { sa.setNegative(false); cgb.assertionMap.$put(sa.getId(), sa); cgb.assertionsFilledIn++; cgb.checkAssertionDetailsFetched(); } });
public void addEdge(String source, String target, String relationType) { if (!graphContainsEdge(source,target,relationType)) { edges.push(new CgEdge(source,target,relationType)); String edgeKey = getEdgeKey(source,target,relationType); edgeMap.$put(edgeKey,edgeKey); } }
@Override public void $invoke(String p1) { if (relDone.$get(id)) { if (success != null) success.$invoke(p1); } else { levelDone.$put(id, true); } } }, failure);
public void asNQuads(Callback1<String> success, Callback1<String> failure, String signatureSheet) { final FormData fd = new FormData(); final String id = this.id; if (signatureSheet != null || signatureSheet != JSGlobal.undefined) fd.append("signatureSheet", signatureSheet); Map<String, String> headers = JSCollections.$map(); headers.$put("Accept", "text/n4"); EcRemote.postWithHeadersExpectingString(id, "", fd, headers, success, failure); }
public void addNode(String id) { if (!graphContainsNode(id)) { nodes.push(id); nodeMap.$put(id,id); } }
public void addNode(Node n) { if (nodeMap.$get(n.getId()) == null) { nodeList.push(n); nodeMap.$put(n.getId(), n); } }
@Override public void $invoke(String p1) { if (levelDone.$get(id)) { if (success != null) success.$invoke(p1); } else { relDone.$put(id, true); } } }, failure);
public void asTurtle(Callback1<String> success, Callback1<String> failure, String signatureSheet) { final FormData fd = new FormData(); final String id = this.id; if (signatureSheet != null || signatureSheet != JSGlobal.undefined) fd.append("signatureSheet", signatureSheet); Map<String, String> headers = JSCollections.$map(); headers.$put("Accept", "text/turtle"); EcRemote.postWithHeadersExpectingString(id, "", fd, headers, success, failure); } }
public void mergeNodePackets(NodePacket packet1, NodePacket packet2) { if (packet1 != packet2) { Node n; Array<Node> na = packet2.getNodeList(); for (int i=0;i<na.$length();i++) { n = na.$get(i); packet1.addNode(n); nodePacketMap.$put(n.getId(),packet1); } nodePacketList = ArrayUtil.arrayRemove(nodePacketList,packet2); } }