Ejemplo n.º 1
0
 protected String getColor(OWLOntology o, OWLEntity owlEntity) {
   return getAnnotationValueByUri(o, owlEntity, OntologyLumifyProperties.COLOR.getPropertyName());
 }
Ejemplo n.º 2
0
  protected Concept importOntologyClass(
      OWLOntology o, OWLClass ontologyClass, File inDir, Authorizations authorizations)
      throws IOException {
    String uri = ontologyClass.getIRI().toString();
    if ("http://www.w3.org/2002/07/owl#Thing".equals(uri)) {
      return getEntityConcept();
    }

    String label = getLabel(o, ontologyClass);
    checkNotNull(label, "label cannot be null or empty: " + uri);
    LOGGER.info("Importing ontology class " + uri + " (label: " + label + ")");

    Concept parent = getParentConcept(o, ontologyClass, inDir, authorizations);
    Concept result = getOrCreateConcept(parent, uri, label);

    String color = getColor(o, ontologyClass);
    if (color != null) {
      result.setProperty(
          OntologyLumifyProperties.COLOR.getPropertyName(),
          color,
          OntologyRepository.VISIBILITY.getVisibility(),
          authorizations);
    }

    String displayType = getDisplayType(o, ontologyClass);
    if (displayType != null) {
      result.setProperty(
          OntologyLumifyProperties.DISPLAY_TYPE.getPropertyName(),
          displayType,
          OntologyRepository.VISIBILITY.getVisibility(),
          authorizations);
    }

    String titleFormula = getTitleFormula(o, ontologyClass);
    if (titleFormula != null) {
      result.setProperty(
          OntologyLumifyProperties.TITLE_FORMULA.getPropertyName(),
          titleFormula,
          OntologyRepository.VISIBILITY.getVisibility(),
          authorizations);
    }

    String subtitleFormula = getSubtitleFormula(o, ontologyClass);
    if (subtitleFormula != null) {
      result.setProperty(
          OntologyLumifyProperties.SUBTITLE_FORMULA.getPropertyName(),
          subtitleFormula,
          OntologyRepository.VISIBILITY.getVisibility(),
          authorizations);
    }

    String timeFormula = getTimeFormula(o, ontologyClass);
    if (timeFormula != null) {
      result.setProperty(
          OntologyLumifyProperties.TIME_FORMULA.getPropertyName(),
          timeFormula,
          OntologyRepository.VISIBILITY.getVisibility(),
          authorizations);
    }

    boolean userVisible = getUserVisible(o, ontologyClass);
    result.setProperty(
        OntologyLumifyProperties.USER_VISIBLE.getPropertyName(),
        userVisible,
        OntologyRepository.VISIBILITY.getVisibility(),
        authorizations);

    String glyphIconFileName = getGlyphIconFileName(o, ontologyClass);
    setIconProperty(
        result,
        inDir,
        glyphIconFileName,
        LumifyProperties.GLYPH_ICON.getPropertyName(),
        authorizations);

    String mapGlyphIconFileName = getMapGlyphIconFileName(o, ontologyClass);
    setIconProperty(
        result,
        inDir,
        mapGlyphIconFileName,
        LumifyProperties.MAP_GLYPH_ICON.getPropertyName(),
        authorizations);

    return result;
  }