Beispiel #1
0
  @Override
  public Service getIndividual() {
    Service service = null;
    if (allFieldsPopulated() && !isForReading) { // create service
      WSDLTranslatorBuilder builder =
          new WSDLTranslatorBuilder(model.getOntology(), operationName, wsdlURL);

      service = builder.getTranslator().getService();

      service.setLabel(label, null);

      if (isOperatorService) {
        service.addProperty(supportingToolkitProperty, getToolkitAsOWLIndividual());
        service.addProperty(implementsOperatorProperty, getOperatorAsOWLIndividual());
      } else service.addProperty(implementsExtractorProperty, getExtractorAsOWLIndividual());
    } else if (!allFieldsPopulated() && !isForReading) {
      System.out.println("all fields not populated....");
    } else { // read service and populate service object
      service = model.readService(uri);

      OWLIndividual operator = service.getProperty(implementsOperatorProperty);
      OWLIndividual toolkit = service.getProperty(supportingToolkitProperty);
      OWLIndividual extractor = service.getProperty(implementsExtractorProperty);

      ViskoModel viskoModel = new ViskoModel();

      if (operator != null && toolkit != null) {
        supportingToolkit = new Toolkit(toolkit.getURI().toASCIIString(), viskoModel);
        implementedOperator = new Operator(operator.getURI().toASCIIString(), viskoModel);
      }

      if (extractor != null)
        implementedExtractor = new Extractor(extractor.getURI().toASCIIString(), viskoModel);
    }

    return service;
  }
Beispiel #2
0
 /* @see org.mindswap.owl.OWLObject#getURI() */
 public URI getURI() {
   return individual.getURI();
 }