File size: 4,037 Bytes
c118a1c
 
 
 
 
 
 
 
 
 
 
 
 
 
af2e8ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c118a1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
df1c22f
 
c118a1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2c3b23e
c118a1c
 
 
2c3b23e
c118a1c
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
---
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

**`cq_to_onto_<domain>.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?"}
]
```

**`cq_to_terms_<domain>.json`** (CQ2Term gold): 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?",
    "classes": ["Wine", "WineDescriptor"],
    "properties": ["hasWineDescriptor"]
  }
]
```

**`sub_<domain>.owl`**: OWL source code in RDF/XML. CQ-driven restriction of the source ontology, retaining only what's required to satisfy the CQs.

**`<Domain>_CQs_Annotations.xlsx`**: annotation process with per-CQ class and property splits, plus axioms.

## Loading

```python
from huggingface_hub import hf_hub_download
import json, rdflib

# CQ2Term: Load Dataset
path = hf_hub_download("ClarkWangPas/CQ2Onto", "wine/cq_to_terms_wine.json", repo_type="dataset")
cqs = json.load(open(path))

# CQ2Onto
path = hf_hub_download("ClarkWangPas/CQ2Onto", "wine/sub_wine.owl", repo_type="dataset")
g = rdflib.Graph().parse(path)
```
## License

Apache 2.0.