Examples of MmiUri


Examples of org.mmisw.ont.mmiuri.MmiUri

           
            // assume "vocabulary"
            String type = "vocabulary";
           
            try {
              MmiUri mmiUri = new MmiUri(ontologyUri);

              String topic = mmiUri.getTopic().toLowerCase();
              if (_isMappingAccordingToTopic(topic)) {
                type = "mapping";
              }
            }
          catch (URISyntaxException e) {
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

            map.put("version_status", versionStatus);

            map.put("authority", "-");

            try {
                MmiUri mmiUri = new MmiUri(ontology.getUri());
                String uri = mmiUri.copyWithVersion(null).clone().getOntologyUri();
                String authority = mmiUri.getAuthority().toLowerCase();

                map.put("uri", uri);
                map.put("version_status", getVersionStatus(versionStatus, authority));
                map.put("authority", authority);
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

    // start the response page:
    response.setContentType("text/plain");
    out = response.getWriter();
   
    // parse the given URI:
    MmiUri mmiUri = null;
    try {
      mmiUri = new MmiUri(fullRequestedUri);
    }
    catch (URISyntaxException e) {
      out.println("ERROR: " +e.getReason());
      return;
    }
   
    String ontologyUri = mmiUri.getOntologyUri();
 
    // obtain info about the ontology:
    String[] foundUri = { null };
      OntologyInfo ontology = db.getOntologyWithExts(mmiUri, foundUri);
   
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

    response.setContentType("text/plain");
    response.setHeader("Access-Control-Allow-Origin", "*");
    out = response.getWriter();
   
    // parse the given URI:
    MmiUri mmiUri = null;
    try {
      mmiUri = new MmiUri(fullRequestedUri);
    }
    catch (URISyntaxException e) {
      out.println("ERROR: " +e.getReason());
      return;
    }
   
   
    // the ontology that is found and corresponding URI
    OntologyInfo ontology = null;
    String ontologyUri = null;
   
    String version = mmiUri.getVersion();
    if ( version == null || version.equals(MmiUri.LATEST_VERSION_INDICATOR) ) {
      ontology = db.getMostRecentOntologyVersion(mmiUri);
      if ( ontology != null ) {
        ontologyUri = ontology.getUri();
      }
    }
    else {
      String[] foundUri = { null };
      ontology = db.getOntologyWithExts(mmiUri, foundUri);
        if ( ontology != null ) {
          ontologyUri = foundUri[0];
        }
    }

      if ( ontology == null ) {
        out.println("ERROR: " +mmiUri.getOntologyUri()+ ": Not found.");
        return;
      }


      // get the CSV corresponding to the found URI
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

    // start the response page:
    response.setContentType("text/plain");
    out = response.getWriter();
   
    // parse the given URI:
    MmiUri mmiUri;
    try {
      mmiUri = new MmiUri(fullRequestedUri);
    }
    catch (URISyntaxException e) {
      out.println("ERROR: " +e.getReason());
      return;
    }
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

    out.println("<body>");
    out.println("<b>" +OntVersion.getFullTitle()+ "</b><br/><br/>");
    out.println(" Full requested URI: <code>" + fullRequestedUri + "</code> <br/><br/>");
   
    // parse the given URI:
    MmiUri mmiUri;
    try {
      mmiUri = new MmiUri(fullRequestedUri);
    }
    catch (URISyntaxException e) {
      out.println("<font color=\"red\">ERROR: " +e.getReason()+ "</font><br/>");
      out.println("</body>");
      out.println("</html>");
      return;
    }
   
    String ontologyUri = mmiUri.getOntologyUri();
 
    // show the parse result:
    String authority = mmiUri.getAuthority();
    String topic = mmiUri.getTopic();
    String version = mmiUri.getVersion();
    String term = mmiUri.getTerm();
    out.println("Parse result: OK<br/>");
    out.println("<pre>");
    out.println("       Ontology URI: " + ontologyUri);
    out.println("          authority: " + authority);
    out.println("            version: " + (version != null ? version : "(not given)"));
    out.println("              topic: " + topic);
    out.println("               Term: " + term);
    out.println("</pre>");

   
    // report something about the available versions:
    out.println("Available versions:");
    out.println("<pre>");
    for ( OntologyInfo ont : db.getOntologyVersions(mmiUri) ) {
      out.println("   " +ont.getUri());
    }
    out.println("</pre>");
   
   
   
    // obtain info about the ontology:
    String[] foundUri = { null };
      OntologyInfo ontology = db.getOntologyWithExts(mmiUri, foundUri);
   
      out.println("<br/>Database result:<br/> ");
   
      if ( ontology != null ) {
      out.println(foundUri[0]+ ": <font color=\"green\">Found.</font> <br/>");
      }
      else {
        out.println(ontologyUri+ ": <font color=\"red\">Not found.</font> <br/>");
        out.println("</body>");
        out.println("</html>");
        return;
      }

   
    // prepare info about the path to the file on disk:
      File file = OntServlet.getFullPath(ontology, ontConfig, log);

    // report the db info and whether the file can be read or not:
    out.println(" Ontology entry FOUND: <br/>");
    out.println("<pre>");
    out.println("                 id: " + ontology.getId());
    out.println("        ontology_id: " + ontology.getOntologyId());
    out.println("          file_path: " + ontology.getFilePath());
    out.println("           filename: " + ontology.getFilename());
    out.println("</pre>");
    out.println(" Full path: <code>" + file.getAbsolutePath() + "</code> ");
    out.println(" Can read it: <code>" + file.canRead() + "</code> <br/>");

    if ( file.canRead() ) {
      out.println("<br/>");

      String uriFile = file.toURI().toString();
      Model model = JenaUtil2.loadModel(uriFile, false);

      if ( mmiUri.getTerm().length() > 0 ) {
        _showTermInfo(mmiUri, model, out);
      }
      else {
        _showAllTerms(mmiUri, model, out, true);
      }
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

      String authority;
      String shortName;
     
      if ( OntServiceUtil.isOntResolvableUri(ontologyUri) ) {
        try {
          MmiUri mmiUri = new MmiUri(ontologyUri);
          authority = mmiUri.getAuthority();
          shortName = mmiUri.getTopic();
          unversionedUri = mmiUri.copyWithVersion(null).getOntologyUri();
        }
        catch (URISyntaxException e) {
          // shouldn't happen.
         
          String error = "Shouldn't happen: ont-resolvable URI is not an MmiUri: "
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

   
    log.debug("getOntologyInfo: ontologyUri=" +ontologyUri+ "  version=" +version);
   
    if ( OntServiceUtil.isOntResolvableUri(ontologyUri) ) {
      try {
        MmiUri mmiUri = new MmiUri(ontologyUri);
        return _getOntologyInfoFromMmiUri(ontologyUri, mmiUri, version);
      }
      catch (URISyntaxException e) {
        String error = e.getMessage();
        log.error("getOntologyInfo: Error in URI: " +ontologyUri, e);
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

      String authority;
      String shortName;
     
      if ( OntServiceUtil.isOntResolvableUri(ontologyUri) ) {
        try {
          MmiUri mmiUri = new MmiUri(ontologyUri);
          authority = mmiUri.getAuthority();
          shortName = mmiUri.getTopic();
          unversionedUri = mmiUri.copyWithVersion(null).getOntologyUri();
        }
        catch (URISyntaxException e) {
          // shouldn't happen.
         
          String error = "Shouldn't happen: ont-resolvable URI is not an MmiUri: "
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

   
    log.debug("getOntologyInfo: ontologyUri=" +ontologyUri+ "  version=" +version);
   
    if ( OntServiceUtil.isOntResolvableUri(ontologyUri) ) {
      try {
        MmiUri mmiUri = new MmiUri(ontologyUri);
        return _getOntologyInfoFromMmiUri(ontologyUri, mmiUri, version);
      }
      catch (URISyntaxException e) {
        String error = e.getMessage();
        log.error("getOntologyInfo: Error in URI: " +ontologyUri, 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.