private void createExceptionProperty(Throwable thrown, Resource resource) { if (thrown.getClass().getName().contains(SKIP)) resource.addProperty(DCTerms.description, thrown.getMessage()); else resource.addLiteral(DCTerms.description, Utils.stackTrace(thrown, false)[0]); }
public void rdfMetadata(Resource r, MetaData md) { if (md.getDescription() != null && md.getDescription().length() > 0) r.addLiteral(DC_11.description, md.getDescription()); if (md.getFullname() != null && md.getFullname().length() > 0) r.addLiteral(DC_11.title, md.getFullname()); r.addLiteral(DC_11.identifier, md.getId()); }
public void addProcessor(String pName, String type, String wfNameRef, boolean isTopLevel) throws SQLException { // create a Processor resource in the context of wfNameRef // wfNameRef rdf:type Workflow // pName rdf:type j:Processor // pName part-Of wfNameRef String pNameURI = uriGenerator.makeProcessorURI(pName, wfNameRef); Resource pResource = getModel().createResource(pNameURI, JanusOntology.processor_spec); pResource.addLiteral(JanusOntology.has_processor_type, type); pResource.addLiteral(JanusOntology.is_top_level, isTopLevel); // pm added 9/10 -- adds original pname as comment for later use by other apps that need to lookup the native DB pResource.addLiteral(RDFS_COMMENT, pName); // associate this proc to its workflow Resource wfResource = workflowToResource.get(uriGenerator.makeWorkflowURI(wfNameRef)); if (wfResource != null) { pResource.addProperty(JanusOntology.part_of, wfResource); } // record this in our local mapping table processorToResource.put(pNameURI, pResource); }
public void addWFId(String wfId, String parentWFname, String externalName, Blob dataflow) throws SQLException { String wfNameURI = uriGenerator.makeWorkflowURI(wfId); Resource wfResource = getModel().createResource(wfNameURI, JanusOntology.workflow_spec); // pm added 9/10 -- adds original pname as comment for later use by other apps that need to lookup the native DB wfResource.addLiteral(RDFS_COMMENT, wfId); // record this wf resource locally workflowToResource.put(wfNameURI, wfResource); if (parentWFname != null) { // do we have a resource for the parent? Resource parentWFResource = workflowToResource.get(uriGenerator.makeWorkflowURI(parentWFname)); if (parentWFResource != null) { // link wfResource to its parent wfResource.addProperty(JanusOntology.has_parent_workflow, parentWFResource); } } }
public void addPort(Port v) throws SQLException { String portURI = uriGenerator.makePortURI(v.getWorkflowId(), v.getProcessorName(), v.getPortName(), v.isInputPort()); Resource portResource = getModel().createResource(portURI, JanusOntology.port); //if (v.getType()!=null) portResource.addLiteral(JanusOntology.has_port_type, v.getType()); portResource.addLiteral(JanusOntology.has_port_order, v.getIterationStrategyOrder()); portResource.addLiteral(JanusOntology.is_processor_input, v.isInputPort()); // pm added 9/10 -- adds original pvame as comment for later use by other apps that need to lookup the native DB portResource.addLiteral(RDFS_COMMENT, v.getPortName()); portToResource.put(portURI, portResource); // associate this port to its processor String procURI = uriGenerator.makeProcessorURI(v.getProcessorName(), v.getWorkflowId()); Resource procResource = processorToResource.get(procURI); if (procResource != null) { procResource.addProperty(JanusOntology.has_parameter, portResource); } }
Property p = m.createProperty(xhtmlProperty); if (xhtmlContent != null) { s.addLiteral(p, xhtmlContent); } else { s.addLiteral(p, entry.getValue());
public void writeEntity(Resource res, ONDEXEntity entity, Model model, String graphURI) { // contexts for(ONDEXConcept ctxt : entity.getTags()) { res.addProperty(model.createProperty(ONDEXRdf.contextUri), model.createResource(ONDEXRdf.conceptToUri(graphURI, ctxt))); } // evidence for(EvidenceType evt : entity.getEvidence()) { res.addProperty(model.createProperty(ONDEXRdf.evidenceUri), model.createResource(ONDEXRdf.etToUri(graphURI, evt))); } // Attribute values for(Attribute attribute : entity.getAttributes()) { // todo: add more handlers Property p = model.createProperty(ONDEXRdf.attributeNameToUri(graphURI, attribute.getOfType())); Object value = attribute.getValue(); if (value instanceof String) res.addProperty(p, (String) value); else if (value instanceof Integer) res.addLiteral(p, (Integer) value); else if (value instanceof Double) res.addLiteral(p, (Double) value); else if (value instanceof Boolean) res.addLiteral(p, (Boolean) value); else if (value instanceof Long) res.addLiteral(p, (Long) value); //else res.addProperty(p, value.toString()); } }
vbResource.addLiteral(JanusOntology.has_iteration, vb.getIteration()); vbResource.addLiteral(JanusOntology.has_port_value_order, vb.getPositionInColl()); if (value != null) vbResource.addLiteral(RDFS_COMMENT, value);
assertionResource.addLiteral(ranAsClass, result.getTestClass().getRealClass().getSimpleName());
current.addProperty(SAWSDL.modelReference, refResource); refResource.addProperty(RDF.type, WSMO_LITE.Condition); refResource.addLiteral(RDF.value, cond.getTypedValue()); current.addProperty(SAWSDL.modelReference, refResource); refResource.addProperty(RDF.type, WSMO_LITE.Effect); refResource.addLiteral(RDF.value, effect.getTypedValue());
private void addAttributeDetails(Model model, Resource my_attribute, Attribute att) { Resource attribute_resource = model.createResource(Namespaces.KARMA + "Attribute"); Property rdf_type = model.createProperty(Namespaces.RDF , "type"); Property has_name = model.createProperty(Namespaces.KARMA, "hasName"); Property is_grounded_in = model.createProperty(Namespaces.HRESTS, "isGroundedIn"); my_attribute.addProperty(rdf_type, attribute_resource); my_attribute.addProperty(has_name, att.getName()); // my_part.addProperty(model_reference, XSDDatatype.XSDstring.getURI()); if (att.getIOType() == IOType.INPUT) { String rdf_plain_literal = Namespaces.RDF + "PlainLiteral"; Literal ground_literal = model.createTypedLiteral(att.getGroundedIn(), rdf_plain_literal); my_attribute.addLiteral(is_grounded_in, ground_literal); } }
excerpt.addLiteral(TestDescription.includesText, test.description()); if (specRef != null) { excerpt.addProperty(RDFS.seeAlso, specRef);
Literal literal = resource.getModel().createTypedLiteral( triple.getObject().getLiteralValue()); resource.addLiteral(node.getOntProperty(), literal); rdfNodes.add(literal); } else if (triple.getObject().isURI()) {
if (service.getAddress().length() > 0) { Literal operation_address_literal = model.createTypedLiteral(service.getAddress(), uri_template); myservice.addLiteral(has_address, operation_address_literal);
.addLiteral( API.page, page ) .addLiteral( OpenSearch.itemsPerPage, perPage ) .addLiteral( OpenSearch.startIndex, perPage * page + 1 ) thisMetaPage.addLiteral( OpenSearch.totalResults, totalResults.intValue() );