@Override
public List<ProcessingElementDescriptor> getProcessingElementMetadata(
String processingElementName) {
List<ProcessingElementDescriptor> listPE;
listPE = new ArrayList<ProcessingElementDescriptor>();
ProcessingElementDescriptor peDescriptor = new SimpleProcessingElementDescriptor(
processingElementName, null, null, "");
try {
String SPARQLquery = "PREFIX dmi: <http://www.admire-project.eu/ontologies/CRISP-DMIOntology.owl#> "
+ "PREFIX platform: <http://www.admire-project.eu/ontologies/PlatformOntology.owl#> "
+ "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> "
+ "PREFIX dcterms: <http://purl.org/dc/elements/1.1/> "
+ "SELECT ?p ?value "
+ "WHERE { ?pe dcterms:title \""
+ processingElementName
+ "\" . ?pe platform:hasStatus \"active\" . ?pe ?p ?value } ";
RDFActivityApp mApp = new RDFActivityApp(mAddress);
List<List<String>> results;
results = new ArrayList<List<String>>();
results = mApp.query(SPARQLquery);
Map<String, String> metadataMap;
metadataMap = new HashMap<String, String>();
for (List<String> list : results) {
// System.out.println(list);
if (list.get(0).contains("hasRepositoryLocation")
| list.get(0).contains("hasInput")
| list.get(0).contains("hasOutput")
| list.get(0).contains("hasStatus")
| list.get(0).contains("22-rdf-syntax-ns#type")) {
} else {
metadataMap.put(list.get(0), list.get(1));
}
}
peDescriptor.setMetadata(metadataMap);
listPE.add(peDescriptor);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}