--- license: apache-2.0 language: - en pretty_name: CQ2Onto size_categories: - n<1K task_categories: - text-generation tags: - ontology-engineering - ontology-generation - term-extraction - benchmark configs: - config_name: cq2onto data_files: - split: wine path: wine/cq_to_onto_wine.json - split: awo path: awo/cq_to_onto_awo.json - split: odrl path: odrl/cq_to_onto_odrl.json - split: water path: water/cq_to_onto_water.json - split: vgo path: vgo/cq_to_onto_vgo.json - split: swo path: swo/cq_to_onto_swo.json - config_name: cq2term data_files: - split: wine path: wine/cq_to_terms_wine.json - split: awo path: awo/cq_to_terms_awo.json - split: odrl path: odrl/cq_to_terms_odrl.json - split: water path: water/cq_to_terms_water.json - split: vgo path: vgo/cq_to_terms_vgo.json - split: swo path: swo/cq_to_terms_swo.json --- # CQ2Onto Benchmark & Dataset Benchmark for evaluating LLM-assisted ontology generation from competency questions, across six domains. For each domain the dataset provides a gold OWL ontology, two CQ files (one per evaluation task), and the annotation spreadsheet used during construction. Each Ontology contains a set of CQs for `CQ2Term`, a set of CQs for `CQ2Onto`, a owl source file that representing all CQs for `CQ2Onto`, and an excel contains all annotation process. More details can be found [here](https://github.com/oeg-upm/OntologyEngineeringBenchmark). Two tasks: - **CQ2Term**: given a CQ, extract all possible classes and properties. - **CQ2Onto**: given a set of CQs, produce a full OWL ontology. ## Dataset Construction We have selected six ontologies in three diferent scales: | Ontology | Tier | Source CQs | Retained | New ⋆ | CQ2Onto set | CQ2Term set | |----------|------|-----------:|---------:|------:|------------:|------------:| | Wine | small | 7 | 4 | 1 | 5 | 5 | | AWO | small | 14 | 7 | 0 | 7 | 7 | | ODRL | medium | 35 | 13 | 6 | 19 | 19 | | Water | medium | 43 | 21 | 0 | 21 | 20 | | VGO | large | 68 | 30 | 1 | 31 | 22 | | SWO | large | 88 | 35 | 0 | 35 | 26 | All sources of the selected ontologies: - **wine**: [Wine Ontology](https://github.com/UCDavisLibrary/wine-ontology) - **awo**: [African Wildlife Ontology](https://people.cs.uct.ac.za/~mkeet/OEbook/ontologies/AfricanWildlifeOntology1.owl) - **odrl**: [ODRL Vocabulary Ontology](https://www.w3.org/ns/odrl/2/) - **water**: [SAREF4WATR Ontology](https://saref.etsi.org/saref4watr/v1.1.1/) - **vgo**: [Video Game Ontology](https://vocab.linkeddata.es/vgo/) - **swo**: [Software Ontology](https://obofoundry.org/ontology/swo.html) ## File formats ### Annotation Records: **`_CQs_Annotations.xlsx`**: annotation process with per-CQ class and property splits, plus axioms. ### CQ2Onto Task: **`cq_to_onto_.json`** (CQ2Onto Input): list of CQs. Gold standard is the ontology, corresponding to `.owl` file. ```json [ {"id": "CQ1", "value": "Which wine characteristics should I consider when choosing a wine?"} ] ``` **`sub_.owl`** (CQ2Onto Gold Standard): OWL source code in RDF/XML. CQ-driven restriction of the source ontology, retaining only what's required to satisfy the CQs. ### CQ2Term Task: **`cq_to_terms_.json`** (CQ2Term Input & Gold Standard): list of CQs, with the gold standard class and property labels. ```json [ { "id": "CQ1", "question": "Which wine characteristics should I consider when choosing a wine?", # Input Competency Question "classes": ["Wine", "WineDescriptor"], # Gold Standard Classes "properties": ["hasWineDescriptor"] # Gold Standard Properties } ] ``` ## Loading ```python from huggingface_hub import hf_hub_download import json, rdflib # CQ2Term: Load Dataset path = hf_hub_download("oeg/CQ2Onto", "wine/cq_to_terms_wine.json", repo_type="dataset") cqs = json.load(open(path)) # CQ2Onto path = hf_hub_download("oeg/CQ2Onto", "wine/sub_wine.owl", repo_type="dataset") g = rdflib.Graph().parse(path) ``` ## License Apache 2.0.