Create a hierarchy of providers organized by first letter of their full
name.

@return the root of the hierarchy.

@throws OntologyBuildException if an error occurs building the hierarchy.
769885
@Override
    public void build(Concept parent) throws OntologyBuildException {
        if (!this.skipProviderHierarchy) {
            try {
                root = this.metadata.getOrCreateHardCodedFolder("Provider");
                root.setFactTableColumn("provider_id");
                root.setTableName("provider_dimension");
                root.setColumnName("provider_path");
                if (parent != null) {
                    root.setAlreadyLoaded(parent.isAlreadyLoaded());
                    parent.add(root);
                }
                alpha = createAlphaCategoryConcepts();
            } catch (InvalidConceptCodeException ex) {
                throw new OntologyBuildException("Could not build provider concept tree", ex);
            }
        }
    }
916179
def get_hierarchies(self):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_template
        catalogs = self._get_provider_session('hierarchy_lookup_session').get_hierarchies()
        cat_list = []
        for cat in catalogs:
            cat_list.append(Hierarchy(self._provider_manager, cat, self._runtime, self._proxy))
        return HierarchyList(cat_list)
761804
public OWLOntology createMergedOntology() throws OWLIOException
    {
        OWLOntologyMerger owlOntologyMerger = new OWLOntologyMerger(owlOntologyManager);
        try
        {
            mergedOntology = owlOntologyMerger.createMergedOntology(owlOntologyManager, IRI.create(mergedOntologyURI()));
            reasonerForMergedOntology = new StructuralReasoner(mergedOntology, new SimpleConfiguration(), BufferingMode.NON_BUFFERING);
            return mergedOntology;
        } catch (OWLOntologyCreationException ex)
        {
            throw new OWLIOException(ioErrorMsg, ex);
        }
    }
49636
private void createOntology() {
    ontologyEntity = ontologyFactory.create();
    ontologyEntity.setId(idGenerator.generateId());
    ontologyEntity.setOntologyIri(loader.getOntologyIRI());
    ontologyEntity.setOntologyName(loader.getOntologyName());
    ontologyRepository.add(ontologyEntity);
  }
1234575
public List depthFirst(boolean preorder) {
        List answer = new NodeList();
        if (preorder) answer.add(this);
        answer.addAll(depthFirstRest(preorder));
        if (!preorder) answer.add(this);
        return answer;
    }
721290
public Node getDOM()
    {
        if (m_message != null)
        {
        	BaseMessage message = m_message.getMessage();
        	return message.getDOM();
        }
        return super.getDOM();	// Null
    }
1183111
public List depthFirst() {
        List answer = new NodeList();
        answer.add(this);
        answer.addAll(depthFirstRest());
        return answer;
    }
86341
public static NamespaceContext createNamespaceContext() {
    return new NamespaceContext() {
      private HashMap<String, String> namespaces = new HashMap<String, String>(1);

      {
        namespaces.put(DEFAULT_NAMESPACE_PREFIX, DEFAULT_NAMESPACE_URI);
      }

      public String getNamespaceURI(String prefix) {
        if (namespaces.isEmpty() || StringUtil.isNullOrEmpty(prefix) || !namespaces.containsKey(prefix))
          return StringUtil.empty;
        return namespaces.get(prefix);
      }

      public Iterator getPrefixes(String namespaceURI) {
        return namespaces.values().iterator();
      }

      public String getPrefix(String namespaceURI) {
        if (StringUtil.isNullOrEmpty(namespaceURI))
          return StringUtil.empty;

        for(Entry<String, String> entry : namespaces.entrySet())
          if (namespaceURI.equals(entry.getValue()))
            return entry.getKey();

        return StringUtil.empty;
      }
    };
  }
106961
@Override
    public Optional<OWLOntology> loadInputOntology() throws OWLOntologyCreationException {
        if (options.ontology.isPresent()) {
            return options.ontology;
        }
        if (owlOntology.isPresent()){
            return owlOntology;
        }
        return loadOntologyFromFile();


    }
863521
function(){
        var hierarchyNames = [], i, n = this.numHierarchies;
        for (i = 0; i < n; i++) hierarchyNames[i] = this._hierarchyOrder[i];
        return hierarchyNames;
    }
1174508
private Entity createOntologyTerm(OWLClass ontologyTermClass) {
    String ontologyTermIRI = ontologyTermClass.getIRI().toString();
    String ontologyTermName = loader.getLabel(ontologyTermClass);
    OntologyTerm ontologyTerm = ontologyTermFactory.create();
    ontologyTerm.setId(idGenerator.generateId());
    ontologyTerm.setOntologyTermIri(ontologyTermIRI);
    ontologyTerm.setOntologyTermName(ontologyTermName);
    ontologyTerm.setOntologyTermSynonyms(createSynonyms(ontologyTermClass));
    ontologyTerm.setOntologyTermDynamicAnnotations(createDynamicAnnotations(ontologyTermClass));
    ontologyTerm.setOntologyTermNodePaths(nodePathsPerOntologyTerm.get(ontologyTermIRI));
    ontologyTerm.setOntology(ontologyEntity);
    ontologyTermRepository.add(ontologyTerm);
    return ontologyTerm;
  }
674027
@SuppressWarnings( "unchecked" )
    public <V> Key<V> getRoot() {
        if ( this.getParent() == null ) {
            return (Key<V>) this;
        } else {
            return this.getParent().getRoot();
        }
    }
205585
public List<Concept> getPathFromRoot() {
        LinkedList<Concept> path = new LinkedList<>();

        Concept node = this;
        while (node != null) {
            path.addFirst(node);
            node = node.parent;
        }

        return path;
    }
1307378
public SelectRootClauseBuilder<? extends QueryForNumber> count() {
		//TODO its hard to know whether or not to innerjoin to get an accurate count here.
		StringBuilder sb = new StringBuilder();
		sb.append("SELECT count(*)");
		sb.append(" FROM ").append(definition.getSqlName());
		//definition.innerJoin(sb);
		SelectRootClauseBuilder<? extends QueryForNumber> r = SelectRootClauseBuilder.newInstance(new RootClauseHandoff<CountBuilder<T>>(sb.toString()) {
			@Override
			protected CountBuilder<T> createBuilder(String sql) {
				return new CountBuilder<T>(SelectBuilderFactory.this, sql);
			}
			
			@Override
			public CountBuilder<T> transform(SelectRootClauseBuilder<CountBuilder<T>> clause) {
				clause.where().limit(1);
				return super.transform(clause);
			}
			
		});
		return r;
	}
165384
public function createInHierarchy( $parentId, $parentType, $rootId, $childId ) {

		$root = $this->getRoot( $rootId, $parentType );

		// Add Root
		if( !isset( $root ) ) {

			$model	= $this->getModelObject();

			$model->rootId		= $rootId;
			$model->parentType	= $parentType;
			$model->lValue		= CoreGlobal::HIERARCHY_VALUE_L;
			$model->rValue		= CoreGlobal::HIERARCHY_VALUE_R;

			// Create Model
			$model->save();
		}

		$model	= $this->getModelObject();

		$model->rootId		= $rootId;
		$model->parentType	= $parentType;

		$model->parentId	= $parentId;
		$model->childId		= $childId;

		// Create Model
		$model->save();
	}
916660
public HelpTopicNode getPreviousSibling() {
        int i = getIndex() - 1;
        return i < 0 ? null : parent.children.get(i);
    }
916611
public static Builder builder() {
    return new AutoValue_HealthDependencyDto.Builder()
        .setName(Optional.empty())
        .setPrimary(false)
        .setType(Optional.empty())
        .setHealthy(false)
        .setLinks(Optional.empty())
        .setMessage(Optional.empty());
  }