Package com.hp.hpl.jena.shared.uuid

Examples of com.hp.hpl.jena.shared.uuid.UUID_V4_Gen


          // [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 = "";
View Full Code Here


    Model model = ds.getDefaultModel();

    model.notifyEvent(GraphEvents.startRead);

    try {
      UUIDFactory factory = new UUID_V4_Gen();
      // I add connection tuple Input and Output properties
      // Resource subject =
      // model.createResource(AdmireRegistryConstants.PlatformOntologyURI
      // + processingElement);
      Resource processingElementSubject = model
          .createResource(AdmireRegistryConstants.PlatformOntologyURI
              + factory.generate().asUUID());
      processingElementSubject.addProperty(model
          .getProperty(AdmireRegistryConstants.dcterms + "title"),
          processingElement);
      processingElementSubject.addProperty(model
          .getProperty(AdmireRegistryConstants.RDFType), model
          .createResource(AdmireRegistryConstants.PlatformOntologyURI
              + peElement.getType()));
      Resource subjectConTupleInput = model
          .createResource(AdmireRegistryConstants.PlatformOntologyURI
              + connectionTupleInput);
      Resource subjectConTupleOutput = model
          .createResource(AdmireRegistryConstants.PlatformOntologyURI
              + connectionTupleOutput);
      Statement stmConTupleInput = model.createStatement(
          processingElementSubject, model.createProperty(hasInput),
          subjectConTupleInput);
      model.add(stmConTupleInput);

      Statement stmConTupleOutput = model.createStatement(
          processingElementSubject, model.createProperty(hasOutput),
          subjectConTupleOutput);
      model.add(stmConTupleOutput);

      String property = AdmireRegistryConstants.PlatformOntologyURI
          + "hasRepositoryLocation";
      Statement stmPropValue = model.createStatement(
          processingElementSubject, model.createProperty(property),
          peElement.getLocation());
      model.add(stmPropValue);

      property = AdmireRegistryConstants.PlatformOntologyURI
          + "hasStatus";
      stmPropValue = model.createStatement(processingElementSubject,
          model.createProperty(property), "active");
      model.add(stmPropValue);

      Property predicateContainsConnection = model
          .createProperty(containsConnection);
      Iterator inputIt = inputList.iterator();
      while (inputIt.hasNext()) {
        PEParameter input = (PEParameter) inputIt.next();
        // I add containsConnection inputName
        RDFNode dcTitle = model
            .createResource(AdmireRegistryConstants.PlatformOntologyURI
                + input.getName());

        RDFNode objectST = model
            .createResource(AdmireRegistryConstants.PlatformOntologyURI
                + factory.generate().asUUID());

        Statement containsConnectionStm = model.createStatement(
            subjectConTupleInput, predicateContainsConnection,
            objectST);
        model.add(containsConnectionStm);

        Statement hasTitle = model.createStatement((Resource) objectST,
            model.createProperty(AdmireRegistryConstants.dcterms
                + "title"), dcTitle);
        model.add(hasTitle);

        // add isDataSourceInput
        Statement stmDataSourceInput = null;
        stmDataSourceInput = model.createStatement((Resource) objectST,
            model.createProperty(hasDataSourceInput), input
                .getDataSourceInput());
        model.add(stmDataSourceInput);

        // add SType if any
        if (input != null) {
          Property predicateST = model
              .createProperty(hasStructuralType);

          if (input.getSTypeType().equals("PrimitiveSType")) {
            addPrimitiveSType(model, input, containsConnectionStm,
                predicateST, input.getDType());
          } else if (input.getSTypeType().equals("any")) {
            addAnyST(model, input, containsConnectionStm,
                predicateST, input.getDType());
          } else if (input.getSTypeType().equals("Array")) {
            addArray(model, input, containsConnectionStm,
                predicateST, input.getDType());
          } else if (input.getSTypeType().equals("List")) {
            addList(model, input, containsConnectionStm,
                predicateST, input.getDType());
          } else if (input.getSTypeType().equals("Tuple")) {
            addTuple(model, input.getSType(),
                containsConnectionStm, predicateST, input
                    .getDType());
          }

          // add equals property
          // what I have to do is to say that two inputs are the
          // same, to do that I have to add a property equalsTo in
          // Connection, when I add the Structural types, which
          // are of type any
        } else {
          // should I add something if there is no SType?
        }
      }

      predicateContainsConnection = model
          .createProperty(containsConnection);
      Iterator outputIt = outputList.iterator();
      while (outputIt.hasNext()) {
        PEParameter output = (PEParameter) outputIt.next();
        // I add containsConnection inputName
        RDFNode object = model
            .createResource(AdmireRegistryConstants.PlatformOntologyURI
                + factory.generate().asString());
        Statement containsConnectionStm = model.createStatement(
            subjectConTupleOutput, predicateContainsConnection,
            object);
        model.add(containsConnectionStm);
View Full Code Here

    protected void exec()
    {
        if ( uuidType == UUID_V1.version )
            JenaUUID.setFactory(new UUID_V1_Gen()) ;
        if ( uuidType == UUID_V4.version )
            JenaUUID.setFactory(new UUID_V4_Gen()) ;

        for ( int i = 0 ; i < number ; i++ )
        {
            if ( resetEachTime && i != 0)
                JenaUUID.reset() ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.shared.uuid.UUID_V4_Gen

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.