public static Model graphToModel(Graph graph) { return graphToModel(graph.getAllStatements()); } }
/** * Creates a new message push result and adds it to this XDI message (template). * @param messagePushResultGraph The message push result graph to add to this XDI message (template). * @return The newly created message push result represented as an XDI inner root. */ public XdiInnerRoot createMessageDeferredPushResult(Graph messagePushResultGraph) { if (messagePushResultGraph == null) throw new NullPointerException(); Iterator<XDIStatement> statements = new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(messagePushResultGraph.getAllStatements())); XdiInnerRoot xdiInnerRoot = this.getXdiSubGraph().getXdiInnerRoot(XDIMessagingConstants.XDI_ADD_DEFER_PUSH, true); while (statements.hasNext()) xdiInnerRoot.getContextNode().setStatement(statements.next()); return xdiInnerRoot; }
/** * Creates a new operation result and adds it to this XDI message (template). * @param operationXDIAddress The operation address to use for the new operation result. * @param resultGraph The result graph to add to this XDI message (template). * @return The newly created operation result represented as an XDI inner root. */ public XdiInnerRoot createOperationResult(XDIAddress operationXDIAddress, Graph resultGraph) { if (resultGraph == null) throw new NullPointerException(); Iterator<XDIStatement> statements = new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(resultGraph.getAllStatements())); XdiInnerRoot xdiInnerRoot = this.getXdiSubGraph().getXdiInnerRoot(operationXDIAddress, true); while (statements.hasNext()) xdiInnerRoot.getContextNode().setStatement(statements.next()); return xdiInnerRoot; }
/** * Creates a new $push operation and adds it to this XDI message (template). * @param targetGraph The target graph with statements to which this operation applies. * @return The newly created $push operation. */ public PushOperation createPushOperation(Graph targetGraph) { return this.createPushOperation(new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(targetGraph.getAllStatements()))); }
/** * Creates a new $do operation and adds it to this XDI message (template). * @param targetGraph The target graph with statements to which this operation applies. * @return The newly created $do operation. */ public DoOperation createDoOperation(Graph targetGraph) { return this.createDoOperation(new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(targetGraph.getAllStatements()))); }
/** * Creates a new operation and adds it to this XDI message (template). * @param operationXDIAddress The operation address to use for the new operation. * @param targetGraph The target graph with statements to which this operation applies. * @return The newly created, empty operation, or null if the operation address is not valid. */ public Operation createOperation(XDIAddress operationXDIAddress, Graph targetGraph) { return this.createOperation(operationXDIAddress, new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(targetGraph.getAllStatements()))); }
/** * Creates a new $del operation and adds it to this XDI message (template). * @param targetGraph The target graph with statements to which this operation applies. * @return The newly created $del operation. */ public DelOperation createDelOperation(Graph targetGraph) { return this.createDelOperation(new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(targetGraph.getAllStatements()))); }
/** * Creates a new $get operation and adds it to this XDI message (template). * @param targetGraph The target graph with statements to which this operation applies. * @return The newly created $get operation. */ public GetOperation createGetOperation(Graph targetGraph) { return this.createGetOperation(new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(targetGraph.getAllStatements()))); }
/** * Creates a new $set operation and adds it to this XDI message (template). * @param targetGraph The target graph with statements to which this operation applies. * @return The newly created $set operation. */ public SetOperation createSetOperation(Graph targetGraph) { return this.createSetOperation(new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(targetGraph.getAllStatements()))); }
/** * Creates a new $connect operation and adds it to this XDI message (template). * @param targetGraph The target graph with statements to which this operation applies. * @return The newly created $connect operation. */ public ConnectOperation createConnectOperation(Graph targetGraph) { return this.createConnectOperation(new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(targetGraph.getAllStatements()))); }
/** * Creates a new $send operation and adds it to this XDI message (template). * @param targetGraph The target graph with statements to which this operation applies. * @return The newly created $send operation. */ public SendOperation createSendOperation(Graph targetGraph) { return this.createSendOperation(new MappingXDIStatementIterator(new SelectingNotImpliedStatementIterator(targetGraph.getAllStatements()))); }