Examples of OntologyInfo


Examples of org.mmisw.ont.OntologyInfo

        "  and v.version_number='" +version+ "'";

      ResultSet rs = _stmt.executeQuery(query);

      if ( rs.next() ) {
        OntologyInfo ontology = new OntologyInfo();
        ontology.setUri(ontologyUri);
        ontology.setId(rs.getString(1));
        ontology.setOntologyId(rs.getString(2));
        ontology.setFilePath(rs.getString(3));

        ontology.setFilename(rs.getString(4));
       
        // TODO Remove this OLD way to determine filename
//        try {
//          URL uri_ = new URL(ontologyUri);
//          ontology.filename = new File(uri_.getPath()).getName();
View Full Code Here

Examples of org.mmisw.ont.OntologyInfo

      }
     
      ResultSet rs = _stmt.executeQuery(query);

      if ( rs.next() ) {
        OntologyInfo ontology = new OntologyInfo();
        ontology.setId(rs.getString(1));
        ontology.setOntologyId(rs.getString(2));
        ontology.setFilePath(rs.getString(3));
       
        ontology.setFilename(rs.getString(4));
       
        ontology.setUri(ontologyUri);

        return ontology;
      }
    }
    catch (SQLException e) {
View Full Code Here

Examples of org.mmisw.ont.OntologyInfo

    // try with given URI:
    String ontologyUri = mmiUri.getOntologyUri();
    if ( log.isDebugEnabled() ) {
      log.debug("getOntologyWithExts: given URI=" +ontologyUri);
    }
    OntologyInfo ontology = this.getOntology(ontologyUri);
    if ( ontology != null ) {
      if ( foundUri != null ) {
        foundUri[0] = ontologyUri;
      }
      return ontology;
View Full Code Here

Examples of org.mmisw.ont.OntologyInfo

      }
     
      ResultSet rs = _stmt.executeQuery(query);

      while ( rs.next() ) {
        OntologyInfo ontology = new OntologyInfo();
        ontology.setId(rs.getString(1));
        ontology.setOntologyId(rs.getString(2));
        ontology.setFilePath(rs.getString(3));
       
        String ontologyUri = rs.getString(4);
        ontology.setUri(ontologyUri);

        ontology.setFilename(rs.getString(5));
        onts.add(ontology);
       
        // TODO Remove this OLD way to determine filename
//        try {
//          URL uri_ = new URL(ontologyUri);
View Full Code Here

Examples of org.mmisw.ont.OntologyInfo

  public OntologyInfo getMostRecentOntologyVersion(MmiUri mmiUri) throws ServletException {
    List<OntologyInfo> onts = getOntologyVersions(mmiUri);
    if ( onts.size() == 0 ) {
      return null;
    }
    OntologyInfo ont = onts.get(0);
    return ont;
  }
View Full Code Here

Examples of org.mmisw.ont.OntologyInfo

   * @return the ontology if found; null if not found.
   * @throws ServletException
   */
  public OntologyInfo getRegisteredOntologyLatestVersion(String potentialOntUri) throws ServletException  {
    log.debug("getRegisteredOntologyLatestVersion: " +potentialOntUri);
    OntologyInfo ontology = null;
    if ( OntUtil.isOntResolvableUri(potentialOntUri) ) {
      try {
        MmiUri mmiUri = new MmiUri(potentialOntUri);
        // ignore version:
        mmiUri = mmiUri.copyWithVersion(null);
View Full Code Here

Examples of org.mmisw.ont.OntologyInfo

        "where v.id = f.ontology_version_id";
     
      ResultSet rs = _stmt.executeQuery(query);
     
          while ( rs.next() ) {
            OntologyInfo ontology = new OntologyInfo();
            ontology.setId(rs.getString(1));
            ontology.setOntologyId(rs.getString(2));
            ontology.setFilePath(rs.getString(3));
            ontology.setFilename(rs.getString(4));
            ontology.setUri(rs.getString(5));
            onts.add(ontology);
          }
    }
    catch (SQLException e) {
      throw new ServletException(e);
View Full Code Here

Examples of org.mmisw.ont.OntologyInfo

      ResultSet rs = _stmt.executeQuery(query);
     
          while ( rs.next() ) {

            OntologyInfo ontology = new OntologyInfo();
            ontology.setId(rs.getString(1));
            ontology.setOntologyId(rs.getString(2));
            ontology.setFilePath(rs.getString(3));
            ontology.setFilename(rs.getString(4));
                String ontology_id = rs.getString(5);
            ontology.setUri(ontology_id);
            ontology.setDisplayLabel(rs.getString(6));

            ontology.setAuthor(rs.getString(7));
            ontology.setVersion(rs.getString(8));
                String version_status = rs.getString(9);
                if (version_status == null || version_status.trim().length() == 0) {
                    if (version_statuses.containsKey(ontology_id)) {
                        version_status = version_statuses.get(ontology_id);
                    }
                    else {
                        version_status = "undefined";
                    }
                }
                version_statuses.put(ontology_id, version_status);
                ontology.setVersionStatus(version_status);

            if ( allVersions ) {
              // just add item immediately:
              onts.add(ontology);
            }
            else {
              // "update" the most recent item for this ontology_id
              mostRecent.put(ontology.getOntologyId(), ontology);
            }
          }

          if ( allVersions ) {
            // just return the list
View Full Code Here

Examples of org.mmisw.ont.OntologyInfo

      log.error("Error removing ontology statements from graph.", e);
      return;
    }
   
    // if any, get latest version that may remain:
    OntologyInfo latestOntology = null;
    try {
      latestOntology = db.getRegisteredOntologyLatestVersion(ontologyUri);
    }
    catch (ServletException e) {
      log.warn("Warning: error while trying to retrieve existing version of ontology. Ignoring error.", e);
View Full Code Here

Examples of org.mmisw.ont.OntologyInfo

    finally {
      _conn2.end();
    }

    // if any, get latest version that may remain:
    OntologyInfo latestOntology = null;
    try {
      latestOntology = db.getRegisteredOntologyLatestVersion(ontologyUri);
    }
    catch (ServletException e) {
      log.warn("Warning: error while trying to retrieve existing version of ontology. Ignoring error.", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.