Retrieves an ontology with a specific IRI.

@param iri the IRI of the ontology
556519
public Ontology getOntology(String iri) {
    org.molgenis.ontology.core.meta.Ontology ontology =
        dataService
            .query(ONTOLOGY, org.molgenis.ontology.core.meta.Ontology.class)
            .eq(ONTOLOGY_IRI, iri)
            .findOne();
    return toOntology(ontology);
  }
710433
public static Optional<IRI> getContainer(final IRI identifier) {
        if (identifier.getIRIString().equals(TRELLIS_DATA_PREFIX)) {
            return Optional.empty();
        }
        final String path = identifier.getIRIString().substring(TRELLIS_DATA_PREFIX.length());
        final int index = Math.max(path.lastIndexOf('/'), 0);
        return Optional.of(rdf.createIRI(TRELLIS_DATA_PREFIX + path.substring(0, index)));
    }
802735
def qname(self, iri: str) -> str:
        
        prefix, namespace, name = self.g.compute_qname(uri)
        qname = prefix + ':' + name
        self.rqname[qname] = iri
        return qname
358849
def anyont_fetch_label(id):
    
    iri = expand_uri(id, strict=False)
    query = """
    SELECT ?label WHERE {{
    <{iri}> rdfs:label ?label
    }}
    """.format(iri=iri)
    bindings = run_sparql(query)
    rows = [r['label']['value'] for r in bindings]
    return rows[0]
678685
public static vrid6_interface_binding[] get(nitro_service service, Long id) throws Exception{
		vrid6_interface_binding obj = new vrid6_interface_binding();
		obj.set_id(id);
		vrid6_interface_binding response[] = (vrid6_interface_binding[]) obj.get_resources(service);
		return response;
	}
471766
protected OntologyBuilder getOntologyBuilder(VersionRows vr, String rootModuleId, String rootModuleVersion,
            Map<String, String> metadata) {
        return new OntologyBuilder(vr, rootModuleId, rootModuleVersion, metadata);
    }
561283
public static NaaccrDictionary getBaseDictionaryByUri(String uri) {
        if (uri == null)
            throw new RuntimeException("URI is required for getting the base dictionary.");
        return getBaseDictionaryByVersion(extractVersionFromUri(uri));
    }
1098240
@Override
    public Set<URI> listOperations(URI serviceUri) {

        if (serviceUri == null || !serviceUri.isAbsolute()) {
            log.warn("The Service URI is either absent or relative. Provide an absolute URI");
            return ImmutableSet.of();
        }

        URI graphUri;
        try {
            graphUri = getGraphUriForElement(serviceUri);
        } catch (URISyntaxException e) {
            log.warn("The namespace of the URI of the service is incorrect.", e);
            return ImmutableSet.of();
        }

        if (graphUri == null) {
            log.warn("Could not obtain a graph URI for the element. The URI may not be managed by the server - " + serviceUri);
            return ImmutableSet.of();
        }

        String queryStr = new StringBuilder()
                .append("SELECT DISTINCT ?op WHERE { \n")
                .append(" GRAPH <").append(graphUri.toASCIIString()).append("> { \n")
                .append(" <").append(serviceUri.toASCIIString()).append("> ").append("<").append(MSM.hasOperation.getURI()).append(">").append(" ?op . ")
                .append(" ?op ").append("<").append(RDF.type.getURI()).append(">").append(" ").append("<").append(MSM.Operation.getURI()).append("> . \n")
                .append(" } \n ")
                .append("} \n ")
                .toString();

        return this.graphStoreManager.listResourcesByQuery(queryStr, "op");
    }
726388
public OntologyTerm getOntologyTerm(String[] iris) {
    List<OntologyTerm> ontologyTerms = Lists.newArrayList();
    for (String iri : iris) {
      org.molgenis.ontology.core.meta.OntologyTerm ontologyTermEntity =
          dataService
              .query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class)
              .eq(ONTOLOGY_TERM_IRI, iri)
              .findOne();
      OntologyTerm ontologyTerm = toOntologyTerm(ontologyTermEntity);
      if (ontologyTerm == null) {
        return null;
      }
      ontologyTerms.add(ontologyTerm);
    }
    return OntologyTerm.and(ontologyTerms.toArray(new OntologyTerm[0]));
  }
777663
def iriToURI(iri):
    """"""
    # According to RFC 3987, section 3.1, "Mapping of IRIs to URIs"
    if isinstance(iri, bytes):
        iri = str(iri, encoding="utf-8")
    return iri.encode('ascii', errors='oid_percent_escape').decode()
41498
protected boolean isTargetUriInScope(String uri) {
		if (uri == null) {
			return false;
		}
		return getModel().getSession().isInScope(uri);
	}
564743
protected Api getApi(String id) throws IOException {
        Get get = new Get.Builder(getIndexName(), id).type("api").build(); //$NON-NLS-1$
        JestResult result = getClient().execute(get);
        if (result.isSucceeded()) {
            Api api = result.getSourceAsObject(Api.class);
            return api;
        } else {
            return null;
        }
    }
261133
public static linkset_interface_binding[] get(nitro_service service, String id) throws Exception{
		linkset_interface_binding obj = new linkset_interface_binding();
		obj.set_id(id);
		linkset_interface_binding response[] = (linkset_interface_binding[]) obj.get_resources(service);
		return response;
	}
327507
public Catalogue getCatalogue( String uri, Parameter... parameters )
    {
        return invoke( catalogueDigesterLoader, uri, parameters );
    }
594900
def index_ontology(self, ont):
        
        self.merged_ontology.merge([ont])
        syns = ont.all_synonyms(include_label=True)
        
        include_id = self._is_meaningful_ids()
        logging.info("Include IDs as synonyms: {}".format(include_id))
        if include_id:
            for n in ont.nodes():
                v = n
                # Get fragment
                if v.startswith('http'):
                    v = re.sub('.*/','',v)
                    v = re.sub('.*#','',v)
                syns.append(Synonym(n, val=v, pred='label'))
        
        logging.info("Indexing {} syns in {}".format(len(syns),ont))
        logging.info("Distinct lexical values: {}".format(len(self.lmap.keys())))
        for syn in syns:
            self.index_synonym(syn, ont)
        for nid in ont.nodes():
            self.id_to_ontology_map[nid].append(ont)
432243
@Nullable
    public synchronized URI getSystemType() throws IllegalArgumentException {
        URI result = null;
        for (final URI type : get(RDF.TYPE, URI.class)) {
            if (type.getNamespace().equals(KS.NAMESPACE)) {
                Preconditions.checkArgument(result == null, "Multiple system types: " + result
                        + ", " + type);
                result = type;
            }
        }
        return result;
    }
755084
public function withIri(string $iri): self
    {
        $metadata = clone $this;
        $metadata->iri = $iri;

        return $metadata;
    }