Giter Site home page Giter Site logo

edmcouncil / onto-viewer Goto Github PK

View Code? Open in Web Editor NEW
29.0 9.0 10.0 6.47 MB

OntoViewer is an open-source project that is hosted by EDM Council. The project started in May 2019. OntoViewer is a JAVA application that is specifically designed to access both the ontology structure and its content in the easiest possible way. OntoViewer servers both as a web application and REST API.

Home Page: https://spec.edmcouncil.org/fibo/ontology

License: MIT License

Java 97.37% CSS 2.44% HTML 0.02% Shell 0.04% Dockerfile 0.12%
java fibo-viewer java-application ontology-search ontology-documentation onto-viewer auto-viewer

onto-viewer's People

Contributors

dasawanaka avatar dependabot[bot] avatar mereolog avatar patrycjamia avatar przemekgradzki avatar trojczak avatar trypuz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onto-viewer's Issues

Typo in json returned for a search request

The json returned from onto-viewer for a search request contains a typo: "totalResut".
This field should read "totalResult".

Note that when this is fixed we need to update the html-pages - see: edmcouncil/html-pages#110 (comment).

{
    "type": "list",
    "result": [
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/FBC/FunctionalEntities/MarketsIndividuals/Exchange-CCMX",
            "label": "CARTAX",
            "description": "",
            "relevancy": 5,
            "maturityLevel": {
                "label": "release",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Release",
                "icon": "release"
            }
        },
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/MD/CIVTemporal/FundsTemporal/FundsTax",
            "label": "funds tax",
            "description": "",
            "relevancy": 3.75,
            "maturityLevel": {
                "label": "provisional",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Provisional",
                "icon": "develop"
            }
        },
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/MD/CIVTemporal/FundsTemporal/incursTax",
            "label": "incurs tax",
            "description": "",
            "relevancy": 3.333333333333333,
            "maturityLevel": {
                "label": "provisional",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Provisional",
                "icon": "develop"
            }
        },
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/MD/CIVTemporal/FundsTemporal/incursTax.1",
            "label": "incurs tax",
            "description": "",
            "relevancy": 3,
            "maturityLevel": {
                "label": "provisional",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Provisional",
                "icon": "develop"
            }
        },
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/MD/CIVTemporal/FundsTemporal/AccruedTaxes",
            "label": "accrued taxes",
            "description": "",
            "relevancy": 2.5,
            "maturityLevel": {
                "label": "provisional",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Provisional",
                "icon": "develop"
            }
        },
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/FBC/FunctionalEntities/RegulatoryAgencies/TaxAuthority",
            "label": "tax authority",
            "description": "regulatory agency that has jurisdiction over the assessment, determination, collection, imposition and other aspects of any tax",
            "relevancy": 2.5,
            "maturityLevel": {
                "label": "release",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Release",
                "icon": "release"
            }
        },
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Parties/Parties/TaxIdentifier",
            "label": "tax identifier",
            "description": "identifier assigned to a taxpayer that enables compulsory financial charges and other levies to be imposed on the taxpayer by a governmental organization...",
            "relevancy": 2.307692307692308,
            "maturityLevel": {
                "label": "release",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Release",
                "icon": "release"
            }
        },
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/SEC/Debt/Bonds/SpecialTaxBond",
            "label": "special tax bond",
            "description": "bond secured by revenues derived from designated taxes other than ad valorem taxes",
            "relevancy": 2.142857142857143,
            "maturityLevel": {
                "label": "release",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Release",
                "icon": "release"
            }
        },
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/FBC/FunctionalEntities/MarketsIndividuals/Exchange-MKAA",
            "label": "MARKETAXESS ATS",
            "description": "",
            "relevancy": 2,
            "maturityLevel": {
                "label": "release",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Release",
                "icon": "release"
            }
        },
        {
            "iri": "https://spec.edmcouncil.org/fibo/ontology/SEC/Debt/Bonds/TaxAllocationBond",
            "label": "tax allocation bond",
            "description": "bond payable from the incremental increase in tax revenues realized from any increase in property value and other economic activity, often designed...",
            "relevancy": 1.7647058823529413,
            "maturityLevel": {
                "label": "release",
                "iri": "https://spec.edmcouncil.org/fibo/ontology/FND/Utilities/AnnotationVocabulary/Release",
                "icon": "release"
            }
        }
    ],
    "query": "tax",
    "page": 1,
    "hasMore": true,
    "maxPage": 9,
    "totalResut": 86
}

Usages of individuals

Fix display of classes on the auto-viewer page

Expand and collapse long lists

Some resources in FIBO are now displayed as rather long pages of text - see, for example, https://spec.edmcouncil.org/fibo/ontology/IND/EconomicIndicators/NorthAmericanIndicators/USEconomicIndicators/UrbanConsumerPriceIndex.

I think such pages were more readable if such long lists of items as generated descriptions will be displayed by default as collapsed provided that they are longer than, say, 5 items.

I think this change needs to be applied to all such lists, in particular to:

  1. IS-A restrictions
  2. IS-A restrictions inherited from superclasses
  3. generated description
  4. Usage

Use Spring built-in request logging instead of hard-coded logging

Currently, in many controllers, we use something like this:

LOG.debug("[REQ] GET : api / stats");
Instead of that, we would like to have more robust requests logging. This can be done using Spring's built-in logging capabilities.

To fulfill this task, check all of the existing controllers in onto-viewer and remove all manual request logging. Also, implement the aforementioned Spring-based request logging handling.

Ontology format support

We need to be able to load ontologies in formats other than RDF/XML, e.g.:

  1. Turtle
  2. OWL/XML
  3. (perhaps) JSON-LD.

Refactor search REST API endpoint

We need to refactor search REST API endpoint so that it is split into two endpoints:

  1. for search for ontologies (e.g., /api/ontology/search)
  2. for search for other resources (e.g., /api/resource/search)

Note that the text searches are now handled by /api/find endpoint.

Find search API returns an error

Page not found default response

Is your feature request related to a problem? Please describe.

Request to https://spec.edmcouncil.org/fibo/ontology/IND/AllFBC/, which is not in FIBO, does not return any default 'page not found' response. Ditto for other mistyped URLs within the FIBO domain.

Describe the solution you'd like

FIBO viewer should return some kind of 404 HTTP response - perhaps with some polite or tongue-in-cheek response like the ones on https://elementor.com/blog/404-page-inspiration/ or similar webpage.

Describe alternatives you've considered

No alternatives exist.

Additional context

"java.lang.IllegalStateException: do not share IndexWriterConfig instances across IndexWriters" on update request

Current Behavior

The following logs appear after the Add a new update request to the queue:

java[57503]: 2022-02-10 23:08:35,769 DEBUG [http-nio-0.0.0.0-9001-exec-9] org.springframework.web.filter.CommonsRequestLoggingFilter: Before request [PUT /auto/ontology/api/update, client=172.25.1.33, headers=[host:"172.25.1.32:9001", user-agent:"curl/7.61.1", accept:"application/json", x-api-key:"_API_KEY_"]] java[57503]: 2022-02-10 23:08:35,776 INFO [UpdateThread-1] org.edmcouncil.spec.ontoviewer.webapp.boot.UpdaterThread: Configuration loaded ? : true java[57503]: 2022-02-10 23:08:35,776 INFO [UpdateThread-1] org.edmcouncil.spec.ontoviewer.webapp.boot.UpdaterThread: File system manager created ? : true java[57503]: 2022-02-10 23:08:35,778 DEBUG [http-nio-0.0.0.0-9001-exec-9] org.springframework.web.filter.CommonsRequestLoggingFilter: After request [PUT /auto/ontology/api/update, client=172.25.1.33, headers=[host:"172.25.1.32:9001", user-agent:"curl/7.61.1", accept:"application/json", x-api-key:"_API_KEY_"]] java[57503]: 2022-02-10 23:08:40,140 INFO [UpdateThread-1] org.edmcouncil.spec.ontoviewer.webapp.search.LuceneSearcher: Starting to populate the Lucene index located on path 'lucene_index'... java[57503]: 2022-02-10 23:08:40,143 INFO [UpdateThread-1] org.edmcouncil.spec.ontoviewer.webapp.search.LuceneSearcher: 'reindexOnStart' not set in the configuration. Using application property value 'true'. java[57503]: 2022-02-10 23:08:40,143 INFO [UpdateThread-1] org.edmcouncil.spec.ontoviewer.webapp.search.LuceneSearcher: Search configuration property 'reindexOnStart' is on. Deleting the old index directory. java[57503]: Exception in thread "UpdateThread-1" java.lang.IllegalStateException: do not share IndexWriterConfig instances across IndexWriters java[57503]: at org.apache.lucene.index.IndexWriterConfig.setIndexWriter(IndexWriterConfig.java:129) java[57503]: at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:917) java[57503]: at org.edmcouncil.spec.ontoviewer.webapp.search.LuceneSearcher.populateIndex(LuceneSearcher.java:192) java[57503]: at org.edmcouncil.spec.ontoviewer.webapp.boot.UpdaterThread.run(UpdaterThread.java:175)

then all subsequent Get update status requests returns:
{ "id": "1", "status": "IN_PROGRESS", "msg": "", "startTimestamp": 1644530915773 }

and /actuator/health request returns:
{ "status": "UP", "components": { "custom": { "status": "UP", "details": { "UPDATE_ONTOLOGY_IN_PROGRESS": true, "BLOCKED": true, "INITIALIZATION_DONE": true } } } }

Expected Behavior

The update process should begin and then complete - get update status requests should return:
{ "id": "1", "status": "DONE", "msg": "", "startTimestamp": 1644530915773 }

Steps to Reproduce

curl -v -H 'Accept: application/json' -H 'X-API-Key: _API_KEY_' https://spec.edmcouncil.org/fibo/ontology/master/latest/api/update -X PUT

Removal of staticOntologies folder

We should separate code from ontology data, in particular, we should avoid maintaining manual update service - see #155 (comment).

So staticOntologies folder should be removed and code should be improved in such a way that when an imported ontology cannot be downloaded, it informs the user and keeps going.

Initially, we may just log the fact that some ontologies cannot be imported, but later we should log such messages in front end.

Cannot fetch data error

When hint functionality cannot find the appropriate concept in FIBO for a given search string, 'Cannot fetch data' error is thrown
Instead we should catch this error and handle it properly.

Wrong generated descriptions

Expected Behavior

https://spec.edmcouncil.org/fibo/ontology/IND/InterestRates/InterestRates/MarketDataProvider should have this generated description:
Market data provider may publishes published financial information.
or, even better, this one:
Market data provider may publish published financial information.

Current Behavior

https://spec.edmcouncil.org/fibo/ontology/IND/InterestRates/InterestRates/MarketDataProvider has this generated description:
Market data provider publmay behes published financial information.

Context (Environment)

Zrzut ekranu 2021-07-26 o 12 14 20

More comprehensive OntoViewer's logs

OntoViewer logs available without logging into the production server

  • search phrase
  • the search timestamp
  • user id (IP?)
  • the IRI of the resources found, together with their "scores"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.