private void writeManifest(ArrayList<Resource> testcases, String localName, String label, String description) { if (testcases.size() == 0) return; Resource manifest = model.createResource(namespace + localName+"Manifest", TestManifest.Manifest); manifest.addProperty(DCTerms.title, label); manifest.addProperty(TestManifest.name, label); manifest.addProperty(RDFS.comment, description); Resource[] ra={}; RDFList l = model.createList(testcases.toArray(ra)); manifest.addProperty(TestManifest.entries, l); }
public void addResourceMap(URI rem) throws OREException { res.addProperty(ORE.isDescribedBy, model.createResource(rem.toString())); }
public void setCreated(Date created) { SimpleDateFormat sdf = new SimpleDateFormat(JenaOREConstants.dateFormat); String date = sdf.format(created); res.addProperty(DCTerms.created, model.createTypedLiteral(date, JenaOREConstants.dateTypedLiteral)); }
private static void addTypeToAll( Resource type, Set<Resource> candidates ) { List<Resource> types = equivalentTypes( type ); for (Resource element : candidates) { Resource resource = element; for (int i = 0; i < types.size(); i += 1) resource.addProperty( RDF.type, types.get(i) ); } }
public void addSeeAlso(URI seeAlso) throws OREException { res.addProperty(RDFS.seeAlso, model.createTypedLiteral(seeAlso)); }
public void initialise() { res = model.createResource(); // blank node res.addProperty(RDF.type, model.createResource("http://purl.org/dc/terms/Agent")); }
public void clearTypes() { // leave it to OREResource to handle type clearance super.clearTypes(); // ensure that the required type is still set res.addProperty(RDF.type, model.createResource("http://purl.org/dc/terms/Agent")); }
public void addCreator(Agent creator) { // creator is only a flat set of triples, so can be added this way Resource resource = ((AgentJena) creator).getResource(); res.addProperty(DC.creator, resource); this.addResourceToModel(resource); }
public void addCreator(Agent creator) { Resource resource = ((AgentJena) creator).getResource(); res.addProperty(DC.creator, resource); this.addResourceToModel(resource); }
public void relate(Predicate pred, Object literal) throws OREException { Property property = model.createProperty(pred.getURI().toString()); triple.addProperty(property, model.createTypedLiteral(literal)); }
public void addAgent(URI relationship, Agent agent) throws OREException { Resource resource = ((AgentJena) agent).getResource(); res.addProperty(model.createProperty(relationship.toString()), resource); this.addResourceToModel(resource); }
private void addDocumentation(Model model, Service service) { if (service.getDocumentation() != null) { com.hp.hpl.jena.rdf.model.Resource current = model.createResource(service.getUri().toASCIIString()); try { com.hp.hpl.jena.rdf.model.Resource documentationRes = model.createResource(service.getDocumentation().toURI().toASCIIString()); current.addProperty(MSM_NFP.hasDocumentation, documentationRes); } catch (URISyntaxException e) { e.printStackTrace(); } } }
public void relate(Predicate pred, OREResource resource) throws OREException { Property property = model.createProperty(pred.getURI().toString()); triple.addProperty(property, model.createResource(resource.getURI().toString())); }
private void addMethod(Model model, Operation op) { com.hp.hpl.jena.rdf.model.Resource current = model.createResource(op.getUri().toASCIIString()); if (op.getMethod() != null) { current.addProperty(HRESTS.hasMethod, model.createResource(op.getMethod().toASCIIString())); } }
private void addAcceptsContentTypes(Model model, Operation op) { com.hp.hpl.jena.rdf.model.Resource current = model.createResource(op.getUri().toASCIIString()); if (op.getAcceptsContentTypes() != null) { for (URI mediaType : op.getAcceptsContentTypes()) { current.addProperty(HRESTS.acceptsContentType, model.createResource(mediaType.toASCIIString())); } } }
private void addRecentMashups(Model model, Service service) { // Create Recent Mashups Value if (service.getRecentMashups() != null) { com.hp.hpl.jena.rdf.model.Resource current = model.createResource(service.getUri().toASCIIString()); Literal recentMashups = model.createTypedLiteral(service.getRecentMashups()); current.addProperty(MSM_NFP.hasRecentMashups, recentMashups); } }
public void setTypes(List<URI> types) { super.setTypes(types); // ensure that the required type is still set Selector selector = new SimpleSelector(res, RDF.type, ORE.Proxy); StmtIterator itr = model.listStatements(selector); if (!itr.hasNext()) { res.addProperty(RDF.type, ORE.Proxy); } }
public void setTypes(List<URI> types) { super.setTypes(types); // ensure that the required type is still set Selector selector = new SimpleSelector(res, RDF.type, ORE.ResourceMap); StmtIterator itr = model.listStatements(selector); if (!itr.hasNext()) { res.addProperty(RDF.type, ORE.ResourceMap); } }
public void setTypes(List<URI> types) { super.setTypes(types); // ensure that the required type is still set Selector selector = new SimpleSelector(res, RDF.type, ORE.Aggregation); StmtIterator itr = model.listStatements(selector); if (!itr.hasNext()) { res.addProperty(RDF.type, ORE.Aggregation); } }
private void addAddress(Model model, Service service) { if (service.getAddress() != null) { com.hp.hpl.jena.rdf.model.Resource current = model.createResource(service.getUri().toASCIIString()); Literal address = model.createTypedLiteral(service.getAddress(), HRESTS.URITemplate.getURI()); current.addProperty(HRESTS.hasAddress, address); } }