use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class VE_VariableGroup_2_Test method invalid.
@Test
public void invalid() {
Generic vg1 = new Generic();
vg1.setName("not-unique");
Generic vg2 = new Generic();
vg2.setName("not-unique");
builder.build(vg1);
builder.build(vg2);
builder.complete();
List<ValidationDiagnostic<VariableGroup>> diagnostics = validationError.validate();
assertEquals(2, diagnostics.size());
List<VariableGroup> invalidVariableGroups = diagnostics.stream().map(ValidationDiagnostic::getValidatedObject).collect(Collectors.toList());
assertTrue(invalidVariableGroups.contains(vg1));
assertTrue(invalidVariableGroups.contains(vg2));
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class VE_VariableGroup_1 method getInvalidObjects.
@Override
protected List<VariableGroup> getInvalidObjects() {
OWLClass validationErrorClass = context.owl.dataFactory.getOWLClass(VE_VariableGroup_1, context.owl.prefixManager);
Set<OWLNamedIndividual> invalidIndividuals = context.invalidIndividuals.get(validationErrorClass);
return invalidIndividuals.stream().map(individual -> context.variableGroups.get(individual)).collect(Collectors.toList());
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class VE_VariableGroup_2 method getInvalidObjects.
@Override
protected List<VariableGroup> getInvalidObjects() {
OWLClass validationErrorClass = context.owl.dataFactory.getOWLClass(VE_VariableGroup_2, context.owl.prefixManager);
Set<OWLNamedIndividual> invalidIndividuals = context.invalidIndividuals.get(validationErrorClass);
return invalidIndividuals.stream().map(individual -> context.variableGroups.get(individual)).collect(Collectors.toList());
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class VE_VariableGroup_3 method getInvalidObjects.
@Override
protected List<VariableGroup> getInvalidObjects() {
OWLClass validationErrorClass = context.owl.dataFactory.getOWLClass(VE_VariableGroup_3, context.owl.prefixManager);
Set<OWLNamedIndividual> invalidIndividuals = context.invalidIndividuals.get(validationErrorClass);
return invalidIndividuals.stream().map(individual -> context.variableGroups.get(individual)).collect(Collectors.toList());
}
use of com.opensimulationplatform.core.model.modeldescription.variablegroup.VariableGroup in project osp-validator by open-simulation-platform.
the class VariableGroupConnectionOwlBuilder method makeNestedVariableGroupConnections.
private void makeNestedVariableGroupConnections(VariableGroupConnection variableGroupConnection, OWLNamedIndividual individual) {
List<VariableGroup> variableGroupsA = variableGroupConnection.getVariableGroupA().getVariableGroups();
List<VariableGroup> variableGroupsB = variableGroupConnection.getVariableGroupB().getVariableGroups();
for (int i = 0; i < min(variableGroupsA.size(), variableGroupsB.size()); i++) {
VariableGroupConnection connection = new VariableGroupConnection();
connection.setSimulatorA(connection.getSimulatorA());
connection.setSimulatorB(connection.getSimulatorB());
connection.setVariableGroupA(variableGroupsA.get(i));
connection.setVariableGroupB(variableGroupsB.get(i));
OWLNamedIndividual variableGroupConnectionIndividual = this.build(connection);
OWLObjectProperty hasConnection = context.owl.dataFactory.getOWLObjectProperty(op_has_connection, context.owl.prefixManager);
OWLAxiom axiom = context.owl.dataFactory.getOWLObjectPropertyAssertionAxiom(hasConnection, individual, variableGroupConnectionIndividual);
context.axioms.add(axiom);
}
}
Aggregations