int i = 0;
for (i = 4; i < data.length; i++) {
Dataset ds = DatasetStore.create(store);
Model model = ds.getDefaultModel();
model.notifyEvent(GraphEvents.startRead);
try {
// [elementName, BEGIN_PROPERTIES, propName, BEGIN_VALUES,
// val1, val2, END_PROPERTY_VALUES, BEGIN_PROPERTIES,
// propName, BEGIN_VALUES,
// val1, val2, END_PROPERTY_VALUES]
// I add connection tuple Input and Output properties
UUIDFactory factory = new UUID_V4_Gen();
Resource subject = model
.createResource(AdmireRegistryConstants.PlatformOntologyURI
+ factory.generate().asUUID());
i++;
RDFNode objectST;
Statement stmPropValue;
String property = "";
subject.addProperty(model
.getProperty(AdmireRegistryConstants.dcterms
+ "title"), elementName);
if (peType.equals("Element")) {
objectST = model
.createResource(AdmireRegistryConstants.PlatformOntologyURI
+ "Element");
stmPropValue = model.createStatement(subject, model
.getProperty(AdmireRegistryConstants.RDFType),
objectST);
}
while (!data[i].equals("END_PROPERTY_LIST")) {
while (!data[i].equals("BEGIN_PROPERTY")) {
i++;
}
i++;
property = AdmireRegistryConstants.PlatformOntologyURI
+ data[i];
while (!data[i].equals("BEGIN_PROPERTY_VALUES")) {
i++;
}
i++;
while (!data[i].equals("END_PROPERTY_VALUES")) {
objectST = model
.createResource(AdmireRegistryConstants.PlatformOntologyURI
+ data[i]);
stmPropValue = model.createStatement(subject, model
.createProperty(property), objectST);
model.add(stmPropValue);
if (peType.equals("Function")) {
(model
.createResource(AdmireRegistryConstants.PlatformOntologyURI
+ data[i]))
.addProperty(
model
.getProperty(AdmireRegistryConstants.PlatformOntologyURI
+ "ofType"),
model
.createResource(AdmireRegistryConstants.PlatformOntologyURI
+ data[i + 1]));
i++;
model
.add(model
.createLiteralStatement(
(Resource) objectST,
model
.createProperty(AdmireRegistryConstants.PlatformOntologyURI
+ "hasIndex"),
data[i + 1]));
i++;
}
i++;
}
i++;
}
// RDFNode objectST =
// model.createResource(AdmireRegistryConstants.PlatformOntologyURI
// + data[i]);
i++;
property = AdmireRegistryConstants.PlatformOntologyURI
+ "hasRepositoryLocation";
stmPropValue = model.createStatement(subject, model
.createProperty(property), data[i]);
model.add(stmPropValue);
property = AdmireRegistryConstants.PlatformOntologyURI
+ "hasStatus";
stmPropValue = model.createStatement(subject, model
.createProperty(property), "active");
model.add(stmPropValue);
subject
.addProperty(
model
.getProperty(AdmireRegistryConstants.RDFType),
model
.createResource(AdmireRegistryConstants.PlatformOntologyURI
+ peType));
i++;
} finally {
model.notifyEvent(GraphEvents.finishRead);
model.close();
store.close();
}
break;
}
} else if (data[0].equals("DELETE_ELEMENT")) {
String elementName = data[1];
Dataset ds = DatasetStore.create(store);
Model model = ds.getDefaultModel();
model.notifyEvent(GraphEvents.startRead);
try {
Resource subject = model
.getResource(AdmireRegistryConstants.PlatformOntologyURI