Package org.mmisw.orrclient.gwt.client.rpc

Examples of org.mmisw.orrclient.gwt.client.rpc.TempOntologyInfo


      // this should not normally happen -- only while I'm testing other functionalities
      Window.alert("No user logged in at this point--Please report this bug.");
      return;
    }
   
    TempOntologyInfo tempOntologyInfo = getTempOntologyInfo();
   
    if ( uploadFileIndicated ) {
      if ( tempOntologyInfo == null ) {
        // this should not normally happen -- only while I'm testing other functionalities
        Window.alert("Upload of file as indicated but no ontology has been uploaded--Please report this bug.");
View Full Code Here


    MdDetails(Map<String, String> registeredMdValues) {
      this.registeredMdValues = registeredMdValues;
    }
   
    void prepare() {
      TempOntologyInfo tempOntologyInfo = getTempOntologyInfo();
     
      loadedMdValues = tempOntologyInfo.getOntologyMetadata().getOriginalValues();
     
      Set<String> allKeys = new HashSet<String>();
      allKeys.addAll(loadedMdValues.keySet());
      allKeys.addAll(registeredMdValues.keySet());
     
View Full Code Here

  }

  private Map<String, String> loadedMdValues;

  private void prepareMdInitOptions() {
    TempOntologyInfo tempOntologyInfo = getTempOntologyInfo();
    loadedMdValues = tempOntologyInfo.getOntologyMetadata().getOriginalValues();
    Orr.log("prepareMdInitOptions: loadedMdValues=" + loadedMdValues);
  }
View Full Code Here

    assert ( newValues != null ) ;
   
    DataCreationInfo dataCreationInfo = createOntologyInfo.getDataCreationInfo();
    assert ( dataCreationInfo instanceof OtherDataCreationInfo ) ;
    final OtherDataCreationInfo otherDataCreationInfo = (OtherDataCreationInfo) dataCreationInfo;
    final TempOntologyInfo tempOntologyInfo = otherDataCreationInfo.getTempOntologyInfo();

   
    // to check if this is going to be a new submission (if ontologyId == null) or, otherwise, a new version.
    final String ontologyId = createOntologyInfo.getPriorOntologyInfo().getOntologyId();
   
   
    final String namespaceRoot = defaultNamespaceRoot;
    final String orgAbbreviation = createOntologyInfo.getAuthority();
    final String shortName = createOntologyInfo.getShortName();


    if ( orgAbbreviation == null ) {
      // should not happen.
      String error = "missing authority abbreviation";
      log.info(error);
      createOntologyResult.setError(error);
      return createOntologyResult;
    }
    if ( shortName == null ) {
      // should not happen.
      String error = "missing short name";
      log.info(error);
      createOntologyResult.setError(error);
      return createOntologyResult;
    }

    if ( ontologyId == null ) {
      // This is a new submission. We need to check for any conflict with a preexisting
      // ontology in the repository with the same shortName+orgAbbreviation combination
      //
      if ( ! Util2.checkNoPreexistingOntology(namespaceRoot, orgAbbreviation, shortName, createOntologyResult) ) {
        return createOntologyResult;
      }
    }
    else {
      // This is a submission of a *new version* of an existing ontology.
      // We need to check the shortName+orgAbbreviation combination as any changes here
      // would imply a *new* ontology, not a new version.
      //

      BaseOntologyInfo baseOntologyInfo = createOntologyInfo.getBaseOntologyInfo();
      assert baseOntologyInfo instanceof RegisteredOntologyInfo;
      RegisteredOntologyInfo roi = (RegisteredOntologyInfo) baseOntologyInfo;

      String originalOrgAbbreviation = roi.getAuthority();
      String originalShortName = roi.getShortName();

      if ( ! Util2.checkUriKeyCombinationForNewVersion(
          originalOrgAbbreviation, originalShortName,
          orgAbbreviation, shortName, createOntologyResult) ) {
        return createOntologyResult;
      }
    }
   
   
    ////////////////////////////////////////////////////////////////////////////
    // section to create the ontology the base:
   
    // external ontology case: the base ontology is already available, just use it
    // by setting the full path in the createOntologyResult:
     
    String full_path;

    if ( tempOntologyInfo != null ) {
      // new contents were provided. Use that:
      full_path = tempOntologyInfo.getFullPath();
    }
    else {
      // No new contents. Only possible way for this to happen is that this is
      // a new version of an existing ontology.

View Full Code Here

    assert ( newValues != null ) ;
   
    DataCreationInfo dataCreationInfo = createOntologyInfo.getDataCreationInfo();
    assert ( dataCreationInfo instanceof OtherDataCreationInfo ) ;
    final OtherDataCreationInfo otherDataCreationInfo = (OtherDataCreationInfo) dataCreationInfo;
    final TempOntologyInfo tempOntologyInfo = otherDataCreationInfo.getTempOntologyInfo();

   
    // to check if this is going to be a new submission (if ontologyId == null) or, otherwise, a new version.
    final String ontologyId = createOntologyInfo.getPriorOntologyInfo().getOntologyId();
   
   
    ////////////////////////////////////////////////////////////////////////////
    // section to create the ontology the base:
   
    // external ontology case: the base ontology is already available, just use it
    // by setting the full path in the createOntologyResult:
     
    String full_path;

    if ( tempOntologyInfo != null ) {
      // new contents were provided. Use that:
      full_path = tempOntologyInfo.getFullPath();
    }
    else {
      // No new contents. Only possible way for this to happen is that this is
      // a new version of an existing ontology.
View Full Code Here

    // and the user indicates that the original base namespace be preserved.
    createOntologyResult.setPreserveOriginalBaseNamespace(false);
   
    if ( dataCreationInfo instanceof OtherDataCreationInfo ) {
      OtherDataCreationInfo odci = (OtherDataCreationInfo) dataCreationInfo;
      TempOntologyInfo toi = odci.getTempOntologyInfo();
      createOntologyResult.setPreserveOriginalBaseNamespace(toi != null && toi.isPreserveOriginalBaseNamespace());
    }

   
    if ( ! createOntologyResult.isPreserveOriginalBaseNamespace() ) {
      // Note: if this is the submission of a new version (ontologyId != null) of an "external" (ie, re-hosted)
      // ontology, then set this flag to true
      if ( ontologyId != null && ! OntServiceUtil.isOntResolvableUri(createOntologyInfo.getUri()) ) {
        createOntologyResult.setPreserveOriginalBaseNamespace(true);
       
        // TODO However, note that we're goint to preserve the URI of the given ontology in this submission,
        // which may not coincide with the previous one.
      }
    }
    //}pons

   
    Map<String, String> newValues = createOntologyInfo.getMetadataValues();
   
    ////////////////////////////////////////////
    // check for errors
   
    if ( createOntologyResult.getError() != null ) {
      log.info(": error: " +createOntologyResult.getError());
      return createOntologyResult;
    }
   
   
    if ( newValues == null ) {
      String error = "Unexpected: no new values assigned for review. Please report this bug";
      createOntologyResult.setError(error );
      log.info(error);
      return createOntologyResult;
    }
   
   
    final String namespaceRoot = defaultNamespaceRoot;
   
    final String orgAbbreviation = newValues.get(OmvMmi.origMaintainerCode.getURI());
    String shortName = newValues.get(Omv.acronym.getURI());
    // TODO: shortName taken NOT from acronym but from a new field explicitly for the shortName piece

    if ( ! createOntologyResult.isPreserveOriginalBaseNamespace() ) {
      //pons: check the following if regular assignment of namespace
     
      if ( orgAbbreviation == null ) {
        log.info("missing origMaintainerCode");
        createOntologyResult.setError("missing origMaintainerCode");
        return createOntologyResult;
      }
     
      if ( shortName == null ) {
       
        if ( ontologyId == null ) {
          // This is a new submission.
          log.info("missing acronym (to be used as shortName)");
          createOntologyResult.setError("missing acronym (to be used as shortName)");
          return createOntologyResult;
        }
        else {
          // take from previous information
          String originalShortName = createOntologyInfo.getShortName();
          shortName = originalShortName;
        }
      }

      if ( ontologyId == null ) {
        // This is a new submission. We need to check for any conflict with a preexisting
        // ontology in the repository with the same shortName+orgAbbreviation combination
        //
        if ( ! Util2.checkNoPreexistingOntology(namespaceRoot, orgAbbreviation, shortName, createOntologyResult) ) {
          return createOntologyResult;
        }
      }
      else {
        // This is a submission of a *new version* of an existing ontology.
        // We need to check the shortName+orgAbbreviation combination as any changes here
        // would imply a *new* ontology, not a new version.
        //
       
        String originalOrgAbbreviation = createOntologyInfo.getAuthority();
        String originalShortName = createOntologyInfo.getShortName();
       
        if ( ! Util2.checkUriKeyCombinationForNewVersion(
            originalOrgAbbreviation, originalShortName,
            orgAbbreviation, shortName, createOntologyResult) ) {
          return createOntologyResult;
        }
      }
    }
    // Else: see below, where we obtain the original namespace.
   
   
    ////////////////////////////////////////////////////////////////////////////
    // section to create the ontology the base:
   
    if ( dataCreationInfo instanceof VocabularyDataCreationInfo ) {
      // vocabulary (voc2rdf) case:
     
      VocabularyDataCreationInfo vocabularyDataCreationInfo = (VocabularyDataCreationInfo) dataCreationInfo;
     
      _createTempVocabularyOntology(createOntologyInfo, vocabularyDataCreationInfo, createOntologyResult);
      if ( createOntologyResult.getError() != null ) {
        return createOntologyResult;
      }
    }
    else if dataCreationInfo instanceof MappingDataCreationInfo ) {
      // mapping (vine case):
     
      MappingDataCreationInfo mappingDataCreationInfo = (MappingDataCreationInfo) dataCreationInfo;
     
      _createTempMappingOntology(createOntologyInfo, mappingDataCreationInfo, createOntologyResult);
      if ( createOntologyResult.getError() != null ) {
        return createOntologyResult;
      }

    }
    else if dataCreationInfo instanceof OtherDataCreationInfo) {
      // external ontology case: the base ontology is already available, just use it
      // by setting the full path in the createOntologyResult:
     
      OtherDataCreationInfo otherDataCreationInfo = (OtherDataCreationInfo) dataCreationInfo;
      TempOntologyInfo tempOntologyInfo = otherDataCreationInfo.getTempOntologyInfo();
     
      String full_path;
     
      if ( tempOntologyInfo != null ) {
        // new contents were provided. Use that:
        full_path = tempOntologyInfo.getFullPath();
      }
      else {
        // No new contents. Only possible way for this to happen is that this is
        // a new version of an existing ontology.
       
View Full Code Here

 
  public TempOntologyInfo getTempOntologyInfo(
      String fileType, String filename,
      boolean includeContents, boolean includeRdf
  ) {
    TempOntologyInfo tempOntologyInfo = new TempOntologyInfo();
   
    if ( metadataBaseInfo == null ) {
      tempOntologyInfo.setError(OrrClientImpl_trailingFragment.class.getSimpleName()+ " not properly initialized. Please report this bug. (metadataBaseInfo not initialized)");
      return tempOntologyInfo;
    }
   
    TempOntologyHelper tempOntologyHelper = new TempOntologyHelper(metadataBaseInfo);
    tempOntologyHelper.getTempOntologyInfo(fileType, filename, tempOntologyInfo, includeRdf);
   
    if ( tempOntologyInfo.getError() != null ) {
      return tempOntologyInfo;
    }
   
    if ( includeContents ) {
      _getOntologyContents(tempOntologyInfo);
View Full Code Here

    ontologyInfo.setOntologyData(otherOntologyData);

    // create dataPanel
    dataPanel = new DataPanel(false);
   
    TempOntologyInfo tempOntologyInfo = (baseOntologyInfo instanceof TempOntologyInfo)
                                      ? (TempOntologyInfo) baseOntologyInfo
                                      : null;
                                     
    dataPanel.updateWith(tempOntologyInfo, ontologyInfo, false);
   
View Full Code Here

   
    String ontologyUri = "http://sweet.jpl.nasa.gov/2.0/top.owl";
    OntologyType ontype = OntTypeUtil.determineType(ontModel, ontologyUri, null);
    assertEquals("ontology type should be Other", OntologyType.OTHER, ontype);

    TempOntologyInfo baseOntologyInfo = new TempOntologyInfo();
    baseOntologyInfo.setUri(ontologyUri);
    OntInfoUtil.getEntities(baseOntologyInfo, ontModel);
   
    OntologyData od = baseOntologyInfo.getOntologyData();
    assertSame("ontology data should be Other", OtherOntologyData.class, od.getClass());
   
    OtherOntologyData mod = (OtherOntologyData) od;
   
    BaseOntologyData bod = mod.getBaseOntologyData();
View Full Code Here

    OntModel ontModel = _load(new File(filename));
   
    OntologyType ontype = OntTypeUtil.determineType(ontModel, ontologyUri, null);
    assertEquals("ontology type should be MAPPING", OntologyType.MAPPING, ontype);

    TempOntologyInfo baseOntologyInfo = new TempOntologyInfo();
    baseOntologyInfo.setUri(ontologyUri);
    OntInfoUtil.getEntities(baseOntologyInfo, ontModel);
   
    OntologyData od = baseOntologyInfo.getOntologyData();
    assertSame("ontology data should be mapping", MappingOntologyData.class, od.getClass());
   
    MappingOntologyData mod = (MappingOntologyData) od;
   
    List<Mapping> mappings = mod.getMappings();
View Full Code Here

TOP

Related Classes of org.mmisw.orrclient.gwt.client.rpc.TempOntologyInfo

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.