Examples of MmiUri


Examples of org.mmisw.ont.mmiuri.MmiUri

    }

    public void testAcceptUntilAuthority() throws URISyntaxException {
     
      // actually only until the authority:
      MmiUri mmiUri = new MmiUri("http://mmisw.org/ont/mmi", true);
      assertEquals("mmi", mmiUri.getAuthority());
      assertEquals("", mmiUri.getExtension());
      assertEquals("", mmiUri.getTopic());
     
      // actually only until the authority including extension:
      mmiUri = new MmiUri("http://mmisw.org/ont/mmi.rdf", true);
      assertEquals("mmi", mmiUri.getAuthority());
      assertEquals(".rdf", mmiUri.getExtension());
      assertEquals("", mmiUri.getTopic());
     
      // but with other stuff as well:
      mmiUri = new MmiUri("http://mmisw.org/ont/mmi/someVocab", true);
      assertEquals("someVocab", mmiUri.getTopic());
      assertEquals("mmi", mmiUri.getAuthority());
    }
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

    final Model model2update = _infModel != null ? _infModel : _model;
    if ( USE_UNVERSIONED ) {
      OntModel model = JenaUtil2.loadModel("file:" +full_path, false);

      if ( OntUtil.isOntResolvableUri(ontology.getUri()) ) {
        MmiUri mmiUri;
        try {
          mmiUri = new MmiUri(ontology.getUri());
          OntModel unversionedModel = UnversionedConverter.getUnversionedModel(model, mmiUri);
          model2update.add(unversionedModel);
        }
        catch (URISyntaxException e) {
          log.error("shouldn't happen", e);
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

   
    // get ontologyUriPattern to do the "like" query:
    String ontologyUriPattern;
    try {
      // use "%" for the version:
      MmiUri mmiUriPatt = mmiUri.copyWithVersionNoCheck("%");
      ontologyUriPattern = mmiUriPatt.getOntologyUri();
    }
    catch (URISyntaxException e) {
      // should not occur.
      log.debug("should not occur.", e);
      return onts;
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

  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);
        ontology = getMostRecentOntologyVersion(mmiUri);
      }
      catch (URISyntaxException e) {
        // Not an MmiUri. Just try to use the argument as given:
        ontology = getOntology(potentialOntUri);
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

   
    if ( USE_UNVERSIONED ) {
      OntModel model = JenaUtil2.loadModel("file:" +full_path, false);

      if ( OntUtil.isOntResolvableUri(ontologyUri) ) {
        MmiUri mmiUri;
        try {
          mmiUri = new MmiUri(ontologyUri);
          OntModel unversionedModel = UnversionedConverter.getUnversionedModel(model, mmiUri);
         
          serialization = JenaUtil2.getOntModelAsString(unversionedModel, "RDF/XML-ABBREV");
         
          ontologyUri = mmiUri.copyWithVersion(null).getOntologyUri();
        }
        catch (URISyntaxException e) {
          log.error("shouldn't happen", e);
          return ;
        }
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

    String ontologyUri = ontology.getUri();
   
    if ( USE_UNVERSIONED ) {

      if ( OntUtil.isOntResolvableUri(ontologyUri) ) {
        MmiUri mmiUri;
        try {
          mmiUri = new MmiUri(ontologyUri);
          ontologyUri = mmiUri.copyWithVersion(null).getOntologyUri();
        }
        catch (URISyntaxException e) {
          log.error("shouldn't happen", e);
          return ;
        }
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

  throws ServletException, IOException {
    OntologyInfo ontology = db.getMostRecentOntologyVersion(req.mmiUri);
    if ( ontology != null ) {
      ontOrEntUri = ontology.getUri();
     
      MmiUri foundMmiUri;
     
      try {
        //
        // Note that mostRecentOntology.getUri() won't have the term component.
        // So, we have to transfer it to foundMmiUri:
        //
        foundMmiUri = new MmiUri(ontology.getUri()).copyWithTerm(req.mmiUri.getTerm());
       
        if ( log.isDebugEnabled() ) {
          log.debug("Found ontology version: " +ontology.getUri());

          if ( ! req.mmiUri.getExtension().equals(foundMmiUri.getExtension()) ) {
            log.debug("Restored requested extension to: " +req.mmiUri);
          }
        }
       
        // also, restore the original requested extension:
        foundMmiUri = foundMmiUri.copyWithExtension(req.mmiUri.getExtension());
      }
      catch (URISyntaxException e) {
        if ( log.isDebugEnabled() ) {
          log.debug("Shouldn't happen", e);
        }
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

      if ( log.isDebugEnabled() ) {
        log.debug("_getRegisteredOntology: isOntResolvableUri: yes");
      }

      try {
        MmiUri mmiUri = new MmiUri(potentialOntUri);
       
        if ( mmiUri.getTerm().length() > 0 ) {
          // potentialOntUri corresponds to a term, not an ontology:
          if ( log.isDebugEnabled() ) {
            log.debug("_getRegisteredOntology: is a term, returning null.");
          }
          return null;
        }
       
        if ( mmiUri.getVersion() == null ) {
          // unversioned request.  Get most recent
          if ( log.isDebugEnabled() ) {
            log.debug("_getRegisteredOntology: unversioned request.");
          }
         
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

      if ( log.isDebugEnabled() ) {
        log.debug("getRegisteredOntology: isOntResolvableUri.");
      }

      try {
        MmiUri mmiUri = new MmiUri(potentialOntUri);
        if ( mmiUri.getVersion() == null ) {
          // unversioned request.  Get most recent
          if ( log.isDebugEnabled() ) {
            log.debug("getRegisteredOntology: unversioned request.");
          }
         
View Full Code Here

Examples of org.mmisw.ont.mmiuri.MmiUri

    // version from versioned ontology mmiUri, if given:
    String version2 = null;
   
    if ( OntUtil.isOntResolvableUri(ontUri) ) {
      try {
        MmiUri mmiUri = new MmiUri(ontUri);
        version2 = mmiUri.getVersion();
       
        if ( version2 == null || version2.length() == 0 ) {
          // insert the version fragment so we are able to search in the database
          ontUri = mmiUri.copyWithVersion(version).getOntologyUri();
          if ( log.isDebugEnabled() ) {
            log.debug("_unregisterOntology: inserted version fragment: " +ontUri);
          }

        }
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.