Refine search
public static BlankNodeOrIRI createEngineExecution(Graph graph, BlankNodeOrIRI chainExecution, BlankNodeOrIRI executionNode){ BlankNodeOrIRI node = new BlankNode(); graph.add(new TripleImpl(node, RDF_TYPE, EXECUTION)); graph.add(new TripleImpl(node, RDF_TYPE, ENGINE_EXECUTION)); graph.add(new TripleImpl(node, EXECUTION_PART, chainExecution)); graph.add(new TripleImpl(node, EXECUTION_NODE, executionNode)); graph.add(new TripleImpl(node, STATUS, STATUS_SCHEDULED)); return node; } /**
public static BlankNodeOrIRI createEngineExecution(Graph graph, BlankNodeOrIRI chainExecution, BlankNodeOrIRI executionNode){ BlankNodeOrIRI node = new BlankNode(); graph.add(new TripleImpl(node, RDF_TYPE, EXECUTION)); graph.add(new TripleImpl(node, RDF_TYPE, ENGINE_EXECUTION)); graph.add(new TripleImpl(node, EXECUTION_PART, chainExecution)); graph.add(new TripleImpl(node, EXECUTION_NODE, executionNode)); graph.add(new TripleImpl(node, STATUS, STATUS_SCHEDULED)); return node; } /**
/** * Adds a property to the node with the specified predicate and object * * @param predicate * @param object */ public void addProperty(IRI predicate, RDFTerm object) { if (resource instanceof BlankNodeOrIRI) { graph.add(new TripleImpl((BlankNodeOrIRI) resource, predicate, object)); } else { throw new RuntimeException("Literals cannot be the subject of a statement"); } }
public static BlankNodeOrIRI createChainExecutionNode(Graph graph, BlankNodeOrIRI executionPlan, IRI ciUri, boolean defaultChain){ BlankNodeOrIRI node = new BlankNode(); graph.add(new TripleImpl(node, RDF_TYPE, EXECUTION)); graph.add(new TripleImpl(node, RDF_TYPE, CHAIN_EXECUTION)); graph.add(new TripleImpl(node, ENHANCES, ciUri)); graph.add(new TripleImpl(ciUri, ENHANCED_BY, node)); graph.add(new TripleImpl(node, STATUS, STATUS_SCHEDULED)); graph.add(new TripleImpl(node, EXECUTION_PLAN, executionPlan)); graph.add(new TripleImpl(node, IS_DEFAULT_CHAIN, lf.createTypedLiteral(defaultChain))); return node; }
/** * Adds a property to the node with the specified predicate and object * * @param predicate * @param object */ public void addProperty(IRI predicate, RDFTerm object) { if (resource instanceof BlankNodeOrIRI) { graph.add(new TripleImpl((BlankNodeOrIRI) resource, predicate, object)); } else { throw new RuntimeException("Literals cannot be the subject of a statement"); } }
public static BlankNodeOrIRI createChainExecutionNode(Graph graph, BlankNodeOrIRI executionPlan, IRI ciUri, boolean defaultChain){ BlankNodeOrIRI node = new BlankNode(); graph.add(new TripleImpl(node, RDF_TYPE, EXECUTION)); graph.add(new TripleImpl(node, RDF_TYPE, CHAIN_EXECUTION)); graph.add(new TripleImpl(node, ENHANCES, ciUri)); graph.add(new TripleImpl(ciUri, ENHANCED_BY, node)); graph.add(new TripleImpl(node, STATUS, STATUS_SCHEDULED)); graph.add(new TripleImpl(node, EXECUTION_PLAN, executionPlan)); graph.add(new TripleImpl(node, IS_DEFAULT_CHAIN, lf.createTypedLiteral(defaultChain))); return node; }
@Override public void scopeAppended(Session session, String scopeId) { final IRI sessionur = getIRIforSession(session), scopeur = getIRIforScope(scopeId); if (sessionur == null || scopeur == null) throw new IllegalArgumentException( "IRIs for scope and session cannot be null."); if (meta instanceof Graph) synchronized (meta) { meta.add(new TripleImpl(sessionur, HAS_APPENDED_URIREF, scopeur)); meta.add(new TripleImpl(scopeur, APPENDED_TO_URIREF, sessionur)); } }
private void updateSessionRegistration(Session session) { final IRI sesur = getIRIforSession(session); // If this method was called after a session rebuild, the following will have little to no effect. synchronized (meta) { // The only essential triple to add is typing meta.add(new TripleImpl(sesur, RDF.type, SESSION_URIREF)); } log.debug("Ontology collector information triples added for session \"{}\".", sesur); }
public static void makeConnected(Graph model, BlankNodeOrIRI root, IRI property) { Set<BlankNodeOrIRI> roots = findRoots(model); LOG.debug("Roots: {}",roots.size()); boolean found = roots.remove(root); //connect all hanging roots to root by property for (BlankNodeOrIRI n: roots) { model.add(new TripleImpl(root,property,n)); } }
@Override public boolean apply(Graph graph, BlankNodeOrIRI subject, Metadata metadata) { for(RDFTerm value : values){ graph.add(new TripleImpl(subject, ontProperty, value)); mappingLogger.log(subject, ontProperty, null, value); } return true; }
public static void makeConnected(Graph model, BlankNodeOrIRI root, IRI property) { Set<BlankNodeOrIRI> roots = findRoots(model); LOG.debug("Roots: {}",roots.size()); boolean found = roots.remove(root); //connect all hanging roots to root by property for (BlankNodeOrIRI n: roots) { model.add(new TripleImpl(root,property,n)); } }
public void updateAddAlias(OWLOntologyID subject, OWLOntologyID object) { // For now add both owl:sameAs statements IRI suben = buildResource(subject), oben = buildResource(object); synchronized (graph) { graph.add(new TripleImpl(suben, OWL.sameAs, oben)); graph.add(new TripleImpl(oben, OWL.sameAs, suben)); } // XXX add the Entry typing later on, but if so give up on using owl:sameAs. }
@Override public void scopeAppended(Session session, String scopeId) { final IRI sessionur = getIRIforSession(session), scopeur = getIRIforScope(scopeId); if (sessionur == null || scopeur == null) throw new IllegalArgumentException( "IRIs for scope and session cannot be null."); if (meta instanceof Graph) synchronized (meta) { meta.add(new TripleImpl(sessionur, HAS_APPENDED_URIREF, scopeur)); meta.add(new TripleImpl(scopeur, APPENDED_TO_URIREF, sessionur)); } }
private void updateSessionRegistration(Session session) { final IRI sesur = getIRIforSession(session); // If this method was called after a session rebuild, the following will have little to no effect. synchronized (meta) { // The only essential triple to add is typing meta.add(new TripleImpl(sesur, RDF.type, SESSION_URIREF)); } log.debug("Ontology collector information triples added for session \"{}\".", sesur); }
public void updateAddAlias(OWLOntologyID subject, OWLOntologyID object) { // For now add both owl:sameAs statements IRI suben = buildResource(subject), oben = buildResource(object); synchronized (graph) { graph.add(new TripleImpl(suben, OWL.sameAs, oben)); graph.add(new TripleImpl(oben, OWL.sameAs, suben)); } // XXX add the Entry typing later on, but if so give up on using owl:sameAs. }
/** * Adds a base URI to the Clerezza platform instance. * * @param baseUri The base URI which will be added to the platform instance */ public void addBaseUri(IRI baseUri) { systemGraph.add(new TripleImpl(getPlatformInstanceRDFTerm(), PLATFORM.baseUri, baseUri)); }
private void attachScopeImportsClerezza(Graph target, org.semanticweb.owlapi.model.IRI prefix) { IRI iri = new IRI(prefix + _id); String scopePrefix = prefix.toString(); scopePrefix = scopePrefix.substring(0, scopePrefix.lastIndexOf("/" + shortName + "/")) + "/ontology/"; for (String scopeID : attachedScopes) { IRI physIRI = new IRI(scopePrefix + scopeID); target.add(new TripleImpl(iri, OWL.imports, physIRI)); } }
@Override public void setDependency(OWLOntologyID dependent, OWLOntologyID dependency) { if (dependent == null) throw new IllegalArgumentException("dependent cannot be null"); if (dependency == null) throw new IllegalArgumentException("dependency cannot be null"); log.debug("Setting dependency."); log.debug(" ... dependent : {}", dependent); log.debug(" ... dependency : {}", dependency); IRI dep = buildResource(dependent), depy = buildResource(dependency); // TODO check for the actual resource! synchronized (meta) { meta.add(new TripleImpl(dep, DEPENDS_ON_URIREF, depy)); } log.debug("DONE setting dependency."); }
private boolean addValue(IRI property, Object value){ RDFTerm rdfValue; try { rdfValue = getRdfResource(value); return factory.getGraph().add(new TripleImpl(rdfNode, property, rdfValue)); } catch (NoConvertorException e){ throw new IllegalArgumentException("Unable to transform "+value.getClass() +" to an RDF Node. Only "+RdfEntity.class+" and RDF Literal Types are supported"); } } private boolean removeValue(IRI property, Object value){
private boolean addValue(IRI property, Object value){ RDFTerm rdfValue; try { rdfValue = getRdfResource(value); return factory.getGraph().add(new TripleImpl(rdfNode, property, rdfValue)); } catch (NoConvertorException e){ throw new IllegalArgumentException("Unable to transform "+value.getClass() +" to an RDF Node. Only "+RdfEntity.class+" and RDF Literal Types are supported"); } } private boolean removeValue(IRI property, Object value){