/** * @param subj * The subject of the statement to be build. * @param pred * The predicate of the statement to be build. * @param obj * The object of the statement to be build. * @return A temporary statement */ private Statement buildTempStatement(final Resource subj, final Property pred, final RDFNode obj) { return this.tempModel.createStatement(subj, pred, obj); }
/** * {@inheritDoc} */ @Override public Statement createStatement(Resource s, Property p, String o) { return super.object.createStatement(s, p, o); }
/** * {@inheritDoc} */ @Override public Statement createStatement(Resource s, Property p, String o, String l) { return super.object.createStatement(s, p, o, l); }
/** * {@inheritDoc} */ @Override public Statement createStatement(Resource s, Property p, String o, boolean wellFormed) { return super.object.createStatement(s, p, o, wellFormed); }
/** * {@inheritDoc} */ @Override public Statement createStatement(Resource s, Property p, String o, String l, boolean wellFormed) { return super.object.createStatement(s, p, o, l, wellFormed); }
private static void addTypingStatements(List<Statement> statements, Set<RDFNode> subjects, Resource rdfType) { Model model = ModelFactory.createDefaultModel(); for( RDFNode s : subjects ) { if (s instanceof Resource) { statements.add( model.createStatement( (Resource) s, RDF.type, rdfType ) ); } } } }
private Statement[] reification(Statement s) { Model m = s.getModel(); Resource r = statement2res.get(s); return new Statement[] { m.createStatement(r, RDF.type, RDF.Statement), m.createStatement(r, RDF.subject, s.getSubject()), m.createStatement(r, RDF.predicate, s.getPredicate()), m.createStatement(r, RDF.object, s.getObject()) }; }
public void addResourceMapURI(URI uri) throws OREException { Resource resource = model.createResource(uri.toString()); model.add(model.createStatement(resource, ORE.describes, res)); model.add(model.createStatement(res, ORE.isDescribedBy, resource)); model.add(model.createStatement(resource, RDF.type, ORE.ResourceMap)); }
private static Statement typeAssertion( Model model, ATermAppl individual, ATermAppl type ) { Resource individualResource = createResource( model, individual ); Property typeProperty = RDF.type; Resource typeResource = createResource( model, type ); return model.createStatement( individualResource, typeProperty, typeResource ); }
private static Statement subClassOfAssertion( Model model, ATermAppl subClass, ATermAppl superClass ) { Resource subClassResource = createResource( model, subClass ); Property subClassOfProperty = RDFS.subClassOf; Resource superClassResource = createResource( model, superClass ); return model.createStatement( subClassResource, subClassOfProperty, superClassResource ); }
private static Statement equivalentClassAssertion( Model model, ATermAppl firstClass, ATermAppl secondClass ) { Resource firstClassResource = createResource( model, firstClass ); Property equivalentClassProperty = OWL2.equivalentClass; Resource secondClassResource = createResource( model, secondClass ); return model.createStatement( firstClassResource, equivalentClassProperty, secondClassResource ); }
@Override public Statement map1( Statement o ) { Statement s = o; return inModel.createStatement( newSubject, s.getPredicate(), s.getObject() ); } };
private void addLocatedInAndLocationOf(final Resource child, final Resource parent) { // add located_in property from the child to the parent final Statement stmt = model.createStatement( child, model.createProperty( LOCATED_IN_URI ), parent ); model.add( stmt ); // add location_of property from the lab to the instrument model.add( model.createStatement( parent, model.createProperty( LOCATION_OF_URI ), child ) ); } }
public static void addLoadedFrom( Model m, String name ) { List<Statement> toAdd = new ArrayList<Statement>(); List<Resource> apis = m .listStatements( null, RDF.type, API.API ) .mapWith(Statement.Util.getSubject) .toList() ; for (Resource api: apis) toAdd.add( m.createStatement( api, ELDA_API.loadedFrom, name ) ); m.add( toAdd ); }
public Model add(Resource s, Property p, String lex, RDFDatatype datatype) { Statement x = model.createStatement(s, RDF.type, PdbOwlVocabulary.Class.Resource.resource()); Statement y = model.createStatement(p, RDF.type, PdbOwlVocabulary.Class.Resource.resource()); model.add(x); model.add(y); return model.add(s, p, lex, datatype); }
public Model add(Resource s, Property p, String o, String l) { Statement x = model.createStatement(s, RDF.type, PdbOwlVocabulary.Class.Resource.resource()); Statement y = model.createStatement(p, RDF.type, PdbOwlVocabulary.Class.Resource.resource()); model.add(x); model.add(y); return model.add(s, p, o, l); }
public Model add(Resource s, Property p, String o, boolean wellFormed) { Statement x = model.createStatement(s, RDF.type, PdbOwlVocabulary.Class.Resource.resource()); Statement y = model.createStatement(p, RDF.type, PdbOwlVocabulary.Class.Resource.resource()); model.add(x); model.add(y); return model.add(s, p, o, wellFormed); }
@Override public Container remove(int index, RDFNode object) { remove(getModel().createStatement(this, RDF.li(index), object)); return this; }
@Override public Container remove(int index, RDFNode o) { // System.err.println( "]] SeqImpl::remove( " + index + ", " + o + ")" ); return remove(getModel().createStatement(this, RDF.li(index), o).remove()); }
private void markThingActionSeen(RepoClient rc, Ident graphToMark, ThingActionSpec tas, Ident seeingAgentID) { Ident actionID = tas.getActionSpecID(); Resource actionRes = rc.getDefaultRdfNodeTranslator().makeResourceForIdent(actionID); Resource agentRes = rc.getDefaultRdfNodeTranslator().makeResourceForIdent(seeingAgentID); Model gm = com.hp.hpl.jena.rdf.model.ModelFactory.createDefaultModel(); scala.Option<String> none = scala.Option.apply(null); // yields None ResourceResolver rr = new ResourceResolver(gm, none); Property viewedByProp = rr.findOrMakeProperty(gm, ThingCN.P_viewedBy); Statement viewedByStmt = gm.createStatement(actionRes, viewedByProp, agentRes); gm.add(viewedByStmt); theLogger.info("Made new-style statement for thing-seen-mark : {}, submitting through RC-portal-wrapper on the assumption that we are already in a Write TX!", viewedByStmt); rc.postNamedModel(graphToMark, gm); }