Creates {@link OntologyTermSynonymMetadata} {@link Entity}s for an ontology term

@param ontologyTerm {@link OWLClass} for the ontology term
@return {@link List} of created synonym {@link Entity}s
345549
private List<OntologyTermSynonym> createSynonyms(OWLClass ontologyTerm) {
    return loader
        .getSynonyms(ontologyTerm)
        .stream()
        .map(this::createSynonym)
        .collect(Collectors.toList());
  }
404913
public QueryRule createShouldQueryRule(String multiOntologyTermIri) {
    QueryRule shouldQueryRule = new QueryRule(new ArrayList<>());
    shouldQueryRule.setOperator(Operator.SHOULD);
    for (String ontologyTermIri : multiOntologyTermIri.split(COMMA_CHAR)) {
      OntologyTerm ontologyTerm = ontologyService.getOntologyTerm(ontologyTermIri);
      List<String> queryTerms = parseOntologyTermQueries(ontologyTerm);
      Double termFrequency = getBestInverseDocumentFrequency(queryTerms);
      shouldQueryRule
          .getNestedRules()
          .add(createBoostedDisMaxQueryRuleForTerms(queryTerms, termFrequency));
    }
    return shouldQueryRule;
  }
275308
public EntityDesc createEntityDesc(
      TableMeta tableMeta, String entityPrefix, String entitySuffix) {
    String name = StringUtil.fromSnakeCaseToCamelCase(tableMeta.getName());
    return createEntityDesc(tableMeta, entityPrefix, entitySuffix, StringUtil.capitalize(name));
  }
1161274
def map_ontologies():
    """"""
    if request.method == 'OPTIONS':
        return {}
    response = request.body.read().decode('utf-8')
    body = json.loads(response)
    stmts_json = body.get('statements')
    stmts = stmts_from_json(stmts_json)
    om = OntologyMapper(stmts, wm_ontomap, scored=True, symmetric=False)
    om.map_statements()
    return _return_stmts(stmts)
1013326
public static TermsEnumTermsQueryBuilder termsEnumTermsQuery(String name, BytesRef[] values, int cacheKey) throws IOException {
    return new TermsEnumTermsQueryBuilder(name, values, cacheKey);
  }
1306396
def create_concept_scheme(rdf, ns, lname=''):
    """"""

    ont = None
    if not ns:
        # see if there's an owl:Ontology and use that to determine namespace
        onts = list(rdf.subjects(RDF.type, OWL.Ontology))
        if len(onts) > 1:
            onts.sort()
            ont = onts[0]
            logging.warning(
                "Multiple owl:Ontology instances found. "
                "Creating concept scheme from %s.", ont)
        elif len(onts) == 1:
            ont = onts[0]
        else:
            ont = None

        if not ont:
            logging.info(
                "No skos:ConceptScheme or owl:Ontology found. "
                "Using namespace auto-detection for creating concept scheme.")
            ns = detect_namespace(rdf)
        elif ont.endswith('/') or ont.endswith('#') or ont.endswith(':'):
            ns = ont
        else:
            ns = ont + '/'

    NS = Namespace(ns)
    cs = NS[lname]

    rdf.add((cs, RDF.type, SKOS.ConceptScheme))

    if ont is not None:
        rdf.remove((ont, RDF.type, OWL.Ontology))
        # remove owl:imports declarations
        for o in rdf.objects(ont, OWL.imports):
            rdf.remove((ont, OWL.imports, o))
        # remove protege specific properties
        for p, o in rdf.predicate_objects(ont):
            prot = URIRef(
                'http://protege.stanford.edu/plugins/owl/protege#')
            if p.startswith(prot):
                rdf.remove((ont, p, o))
        # move remaining properties (dc:title etc.) of the owl:Ontology into
        # the skos:ConceptScheme
        replace_uri(rdf, ont, cs)

    return cs
604352
def entityTriples(rdfGraph, anEntity, excludeProps=False, excludeBNodes=False,
                  orderProps=[RDF, RDFS, OWL.OWLNS, DC.DCNS]):
    
    temp = []
    if not excludeProps:
        excludeProps = []

    # extract predicate/object
    for x, y, z in rdfGraph.triples((anEntity, None, None)):
        if excludeBNodes and isBlankNode(z):
            continue
        if y not in excludeProps:
            temp += [(y, z)]

    # sorting
    if type(orderProps) == type([]):
        orderedUris = sortByNamespacePrefix([y for y, z in temp], orderProps)  # order props only
        orderedUris = [(n + 1, x) for n, x in
                       enumerate(orderedUris)]  # create form: [(1, 'something'),(2,'bobby'),(3,'suzy'),(4,'crab')]
        rank = dict((key, rank) for (rank, key) in orderedUris)  # create dict to pass to sorted procedure
        temp = sorted(temp, key=lambda tup: rank.get(tup[0]))
    elif orderProps:  # default to alpha sorting unless False
        temp = sorted(temp, key=lambda tup: tup[0])

    # if niceURI:
    #	temp = [(uri2niceString(ontology, y), z) for y,z in temp]

    return temp
1234225
@Override
    public List<String> getEntityList(String entityType) throws AtlasException {
        validateTypeExists(entityType);

        return repository.getEntityList(entityType);
    }
697881
protected void addTerm(NormalFormGCI term) {
        if (term instanceof NF1a) {
            final NF1a nf1 = (NF1a) term;
            final int a = nf1.lhsA();
            addTerms(ontologyNF1, a, nf1.getQueueEntry());
        } else if (term instanceof NF1b) {
            final NF1b nf1 = (NF1b) term;
            final int a1 = nf1.lhsA1();
            final int a2 = nf1.lhsA2();
            addTerms(ontologyNF1, a1, nf1.getQueueEntry1());
            addTerms(ontologyNF1, a2, nf1.getQueueEntry2());
        } else if (term instanceof NF2) {
            final NF2 nf2 = (NF2) term;
            addTerms(ontologyNF2, nf2);
        } else if (term instanceof NF3) {
            final NF3 nf3 = (NF3) term;
            addTerms(ontologyNF3, nf3);
        } else if (term instanceof NF4) {
            ontologyNF4.add((NF4) term);
        } else if (term instanceof NF5) {
            ontologyNF5.add((NF5) term);
        } else if (term instanceof NF6) {
            reflexiveRoles.add(((NF6) term).getR());
        } else if (term instanceof NF7) {
            final NF7 nf7 = (NF7) term;
            addTerms(ontologyNF7, nf7);
        } else if (term instanceof NF8) {
            final NF8 nf8 = (NF8) term;
            addTerms(ontologyNF8, nf8);
        } else {
            throw new IllegalArgumentException("Type of " + term
                    + " must be one of NF1 through NF8");
        }
    }
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);
  }
1147532
def ontologyClassTree(self):
        
        treedict = {}
        if self.all_classes:
            treedict[0] = self.toplayer_classes
            for element in self.all_classes:
                if element.children():
                    treedict[element] = element.children()
            return treedict
        return treedict
444560
private static String initCreateEntityWithPropertiesQuery(EntityKeyMetadata entityKeyMetadata) {
		StringBuilder queryBuilder = new StringBuilder( "CREATE " );
		queryBuilder.append( "(n:" );
		queryBuilder.append( ENTITY );
		queryBuilder.append( ":" );
		appendLabel( entityKeyMetadata, queryBuilder );
		// We should not pass a map as parameter as Neo4j cannot cache the query plan for it
		queryBuilder.append( " {props})" );
		queryBuilder.append( " RETURN n" );
		return queryBuilder.toString();
	}
1084837
private Model initModel() {
        OntModel m = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, ModelFactory.createDefaultModel());
        try {
            schemaReader.read(m);
        } catch (RdfReaderException e) {
            log.error("Cannot load ontology: {} ", getSchema(), e);
        }
        return m;
    }
866875
public final ImmutableList<TaxonomyTerm> terms(final String taxonomy) {
      ImmutableList<TaxonomyTerm> terms = taxonomyTerms.get(taxonomy);
      return terms != null ? terms : ImmutableList.of();
   }
1005729
@PostMapping("/getontologyterms")
  public @ResponseBody List<OntologyTerm> getAllOntologyTerms(
      @Valid @RequestBody GetOntologyTermRequest request) {
    return ontologyService.findOntologyTerms(
        request.getOntologyIds(), of(request.getSearchTerm()), 100);
  }
460352
private OntologyTermSynonym createSynonym(String synonym) {
    OntologyTermSynonym entity = ontologyTermSynonymFactory.create();
    entity.setId(idGenerator.generateId());
    entity.setOntologyTermSynonym(synonym);
    synonymRepository.add(entity);
    return entity;
  }
359412
public List<OntologyTerm> getChildren(OntologyTerm ontologyTerm) {
    Iterable<org.molgenis.ontology.core.meta.OntologyTerm> ontologyTermEntities =
        () ->
            dataService
                .query(ONTOLOGY_TERM, org.molgenis.ontology.core.meta.OntologyTerm.class)
                .eq(ONTOLOGY_TERM_IRI, ontologyTerm.getIRI())
                .findAll()
                .iterator();

    List<OntologyTerm> children = new ArrayList<>();
    for (Entity ontologyTermEntity : ontologyTermEntities) {
      Entity ontologyEntity = ontologyTermEntity.getEntity(OntologyTermMetadata.ONTOLOGY);
      ontologyTermEntity
          .getEntities(OntologyTermMetadata.ONTOLOGY_TERM_NODE_PATH)
          .forEach(
              ontologyTermNodePathEntity ->
                  children.addAll(
                      getChildOntologyTermsByNodePath(ontologyEntity, ontologyTermNodePathEntity)));
    }
    return children;
  }