Bohui Zhang commited on
Commit
9abf365
·
1 Parent(s): 1f0f8d6

Update the third version

Browse files
README.md CHANGED
@@ -1,24 +1,21 @@
1
- ---
2
- title: OntoChat
3
- emoji: 📙
4
- colorFrom: yellow
5
- colorTo: gray
6
- sdk: gradio
7
- sdk_version: 4.18.0
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- ---
12
 
13
  # OntoChat
14
 
15
- We introduce **OntoChat**, a framework for conversational ontology engineering that supports requirement elicitation,
16
- analysis, and testing. By interacting with a conversational agent, users can steer the creation of use cases and the
17
- extraction of competency questions, while receiving computational support to analyse the overall requirements and test
18
  early versions of the resulting ontologies.
19
 
20
- ## GitHub Copy
21
- - The source code will also be available soon on GitHub: [King-s-Knowledge-Graph-Lab/OntoChat](https://github.com/King-s-Knowledge-Graph-Lab/OntoChat).
 
 
 
 
 
22
 
23
  ## Note
24
  - The ontology testing part has been tested with the [Music Meta Ontology](https://github.com/polifonia-project/music-meta-ontology) and works well.
@@ -27,6 +24,3 @@ early versions of the resulting ontologies.
27
  - Improve the verbaliser (classes, named entities, and relations might be messy in some cases)
28
  - Optimize clustering visualization (maybe only keep LLM lcustering)
29
  - Add [flagging](https://www.gradio.app/docs/flagging), e.g., [`HuggingFaceDatasetSaver`](https://www.gradio.app/docs/flagging#hugging-face-dataset-saver-header)
30
-
31
-
32
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ <div align="center">
2
+ <img src="assets/title_logo.png" width="96%" height="auto" />
3
+ </div>
 
 
 
 
 
 
 
 
4
 
5
  # OntoChat
6
 
7
+ We introduce **OntoChat**, a framework for conversational ontology engineering that supports requirement elicitation,
8
+ analysis, and testing. By interacting with a conversational agent, users can steer the creation of use cases and the
9
+ extraction of competency questions, while receiving computational support to analyse the overall requirements and test
10
  early versions of the resulting ontologies.
11
 
12
+ ## Deploy
13
+ If you would like to deploy this demo locally,
14
+ 1. Create a python environment and install the requirements using `pip install -r requirements.txt`.
15
+ 2. Run `app.py`.
16
+
17
+ ## Hosting in Hugging Face Spaces
18
+ OntoChat has been hosted in HF Spaces at: [https://huggingface.co/spaces/b289zhan/OntoChat](https://huggingface.co/spaces/b289zhan/OntoChat).
19
 
20
  ## Note
21
  - The ontology testing part has been tested with the [Music Meta Ontology](https://github.com/polifonia-project/music-meta-ontology) and works well.
 
24
  - Improve the verbaliser (classes, named entities, and relations might be messy in some cases)
25
  - Optimize clustering visualization (maybe only keep LLM lcustering)
26
  - Add [flagging](https://www.gradio.app/docs/flagging), e.g., [`HuggingFaceDatasetSaver`](https://www.gradio.app/docs/flagging#hugging-face-dataset-saver-header)
 
 
 
app.py CHANGED
@@ -29,15 +29,8 @@ with gr.Blocks() as user_story_interface:
29
  with gr.Row():
30
  with gr.Column():
31
  user_story_chatbot = gr.Chatbot([
32
- [None, "Hello! I am OntoChat, your conversational ontology engineering assistant."],
33
- ["I am a domain expert trying to create a user story to be used by ontology engineers. You are the "
34
- "ontology expert. Only ask the following question once I have responded. Ask for the specifications "
35
- "to generate a user story as a user of the system, which should include: 1. The Persona: What are "
36
- "the name, occupation, skills and interests of the user? 2. The Goal: What is the goal of the user? "
37
- "Are they facing specific issues? 3. Example Data: Do you have examples of the specific data "
38
- "available? Make sure you have answers to all three questions before providing a user story. Only "
39
- "ask the next question once I have responded.", "Sure. Let's start with the persona. What are the "
40
- "name, occupations, skills, interests of the user?"]
41
  ])
42
  user_story_input = gr.Textbox(
43
  label="Chatbot input",
@@ -92,6 +85,16 @@ with gr.Blocks() as cq_interface:
92
  """
93
  )
94
 
 
 
 
 
 
 
 
 
 
 
95
  with gr.Row():
96
  with gr.Column():
97
  cq_chatbot = gr.Chatbot([
@@ -126,7 +129,8 @@ clustering_interface = gr.Interface(
126
  "the questions before submitting them."
127
  ),
128
  gr.Dropdown(
129
- choices=["Agglomerative clustering", "HDBSCAN", "LLM clustering"],
 
130
  label="Clustering method",
131
  info="Please select the clustering method."
132
  ),
@@ -162,6 +166,17 @@ with gr.Blocks() as testing_interface:
162
  This is the final part of OntoChat which performs ontology testing based on the input ontology file and CQs.
163
  """
164
  )
 
 
 
 
 
 
 
 
 
 
 
165
  ontology_file = gr.File(label="Ontology file")
166
  ontology_desc = gr.Textbox(
167
  label="Ontology description",
 
29
  with gr.Row():
30
  with gr.Column():
31
  user_story_chatbot = gr.Chatbot([
32
+ [None, "Hello! I am OntoChat, your conversational ontology engineering assistant. Let's start with the "
33
+ "persona. What are the name, occupations, skills, interests of the user?"],
 
 
 
 
 
 
 
34
  ])
35
  user_story_input = gr.Textbox(
36
  label="Chatbot input",
 
85
  """
86
  )
87
 
88
+ with gr.Group():
89
+ api_key = gr.Textbox(
90
+ label="OpenAI API Key",
91
+ placeholder="If you have set the key in other tabs, you don't have to set it again.",
92
+ info="Please input your OpenAI API Key if you don't have it set up on your own machine. Please note that "
93
+ "the key will only be used for this demo and will not be uploaded or used anywhere else."
94
+ )
95
+ api_key_btn = gr.Button(value="Set API Key")
96
+ api_key_btn.click(fn=set_openai_api_key, inputs=api_key, outputs=api_key)
97
+
98
  with gr.Row():
99
  with gr.Column():
100
  cq_chatbot = gr.Chatbot([
 
129
  "the questions before submitting them."
130
  ),
131
  gr.Dropdown(
132
+ value="LLM clustering",
133
+ choices=["LLM clustering", "Agglomerative clustering", "HDBSCAN"],
134
  label="Clustering method",
135
  info="Please select the clustering method."
136
  ),
 
166
  This is the final part of OntoChat which performs ontology testing based on the input ontology file and CQs.
167
  """
168
  )
169
+
170
+ with gr.Group():
171
+ api_key = gr.Textbox(
172
+ label="OpenAI API Key",
173
+ placeholder="If you have set the key in other tabs, you don't have to set it again.",
174
+ info="Please input your OpenAI API Key if you don't have it set up on your own machine. Please note that "
175
+ "the key will only be used for this demo and will not be uploaded or used anywhere else."
176
+ )
177
+ api_key_btn = gr.Button(value="Set API Key")
178
+ api_key_btn.click(fn=set_openai_api_key, inputs=api_key, outputs=api_key)
179
+
180
  ontology_file = gr.File(label="Ontology file")
181
  ontology_desc = gr.Textbox(
182
  label="Ontology description",
assets/title_logo.png ADDED
ontochat/__pycache__/analysis.cpython-311.pyc CHANGED
Binary files a/ontochat/__pycache__/analysis.cpython-311.pyc and b/ontochat/__pycache__/analysis.cpython-311.pyc differ
 
ontochat/__pycache__/chatbot.cpython-311.pyc CHANGED
Binary files a/ontochat/__pycache__/chatbot.cpython-311.pyc and b/ontochat/__pycache__/chatbot.cpython-311.pyc differ
 
ontochat/__pycache__/config.cpython-311.pyc ADDED
Binary file (336 Bytes). View file
 
ontochat/__pycache__/functions.cpython-311.pyc CHANGED
Binary files a/ontochat/__pycache__/functions.cpython-311.pyc and b/ontochat/__pycache__/functions.cpython-311.pyc differ
 
ontochat/__pycache__/queries.cpython-311.pyc ADDED
Binary file (594 Bytes). View file
 
ontochat/__pycache__/verbaliser.cpython-311.pyc ADDED
Binary file (11 kB). View file
 
ontochat/chatbot.py CHANGED
@@ -1,20 +1,28 @@
1
  from openai import OpenAI
 
2
 
3
-
4
- MODEL_NAME = "gpt-3.5-turbo"
5
- TEMPERATURE = 0
6
- SEED = 1234
7
 
8
 
9
  def chat_completion(api_key, messages):
10
  client = OpenAI(api_key=api_key)
11
- completion = client.chat.completions.create(
12
- model=MODEL_NAME,
13
- messages=messages,
14
- seed=SEED,
15
- temperature=TEMPERATURE,
16
- )
17
- return completion.choices[0].message.content
 
 
 
 
 
 
 
 
 
 
18
 
19
 
20
  def build_messages(history):
 
1
  from openai import OpenAI
2
+ from openai import APIConnectionError, APITimeoutError, AuthenticationError, RateLimitError
3
 
4
+ from ontochat.config import DEFAULT_MODEL, DEFAULT_SEED, DEFAULT_TEMPERATURE
 
 
 
5
 
6
 
7
  def chat_completion(api_key, messages):
8
  client = OpenAI(api_key=api_key)
9
+ try:
10
+ response = client.chat.completions.create(
11
+ model=DEFAULT_MODEL,
12
+ messages=messages,
13
+ seed=DEFAULT_SEED,
14
+ temperature=DEFAULT_TEMPERATURE,
15
+ )
16
+ except APITimeoutError as e:
17
+ return f"Request timed out. Retry your request after a brief wait. Error information: {e}"
18
+ except APIConnectionError as e:
19
+ return f"Issue connecting to our services. Check your network settings, proxy configuration, " \
20
+ f"SSL certificates, or firewall rules. Error information: {e}"
21
+ except AuthenticationError as e:
22
+ return f"Your API key or token was invalid, expired, or revoked. Error information: {e}"
23
+ except RateLimitError as e:
24
+ return f"You have hit your assigned rate limit. Error information: {e}"
25
+ return response.choices[0].message.content
26
 
27
 
28
  def build_messages(history):
ontochat/config.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Contains macro, works as a config file before we create one.
3
+ """
4
+
5
+ DEFAULT_MODEL = "gpt-3.5-turbo"
6
+ DEFAULT_TEMPERATURE = 0
7
+ DEFAULT_SEED = 1234
8
+
ontochat/functions.py CHANGED
@@ -16,35 +16,30 @@ def set_openai_api_key(api_key: str):
16
 
17
 
18
  def user_story_generator(message, history):
19
- print(history)
20
- if len(history) == 1: # initial round
21
- messages = [{
22
- "role": "system",
23
- "content": "Hello! I am OntoChat, your conversational ontology engineering assistant."
24
- }, {
25
- "role": "user",
26
- "content": "I am a domain expert trying to create a user story to be used by ontology engineers. You are "
27
- "the ontology expert. Only ask the following question once I have responded. Ask for the"
28
- "specifications to generate a user story as a user of the system, which should include: 1. The "
29
- "Persona: What are the name, occupation, skills and interests of the user? 2. The Goal: What is "
30
- "the goal of the user? Are they facing specific issues? 3. Example Data: Do you have examples "
31
- "of the specific data available? Make sure you have answers to all three questions before "
32
- "providing a user story. Only ask the next question once I have responded."
33
- }, {
34
- "role": "system",
35
- "content": "Sure. Let's start with the persona. What are the name, occupations, skills, interests of the user?"
36
- }, {
37
- "role": "user",
38
- "content": message
39
- }]
40
- else:
41
- messages = build_messages(history)
42
- messages.append({
43
- "role": "user",
44
- "content": message
45
- })
46
- bot_message = chat_completion(openai_api_key, messages)
47
  history.append([message, bot_message])
 
48
  return bot_message, history, ""
49
 
50
 
 
16
 
17
 
18
  def user_story_generator(message, history):
19
+ instructions = [{
20
+ "role": "system",
21
+ "content": "You are a conversational ontology engineering assistant."
22
+ }, {
23
+ "role": "user",
24
+ "content": "I am a domain expert trying to create a user story to be used by ontology engineers. You are the "
25
+ "ontology expert. Only ask the following question once I have responded. Ask for the"
26
+ "specifications to generate a user story as a user of the system, which should include: 1. The "
27
+ "Persona: What are the name, occupation, skills and interests of the user? 2. The Goal: What is "
28
+ "the goal of the user? Are they facing specific issues? 3. Example Data: Do you have examples of "
29
+ "the specific data available? Make sure you have answers to all three questions before providing "
30
+ "a user story. Only ask the next question once I have responded. And you should also ask questions "
31
+ "to elaborate on more information after the user provides the initial information, and ask for "
32
+ "feedback and suggestions after the user story is generated."
33
+ }]
34
+ messages = build_messages(history)
35
+ messages.append({
36
+ "role": "user",
37
+ "content": message
38
+ })
39
+ bot_message = chat_completion(openai_api_key, instructions + messages)
40
+ # post-processing response
 
 
 
 
 
 
41
  history.append([message, bot_message])
42
+ print(history)
43
  return bot_message, history, ""
44
 
45
 
ontochat/ontolib.py ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Functions operating on the verbalisation of an ontology, providing support for
3
+ generating documentation, extracting competency questions, and preliminarly
4
+ testing an ontology via competency questions.
5
+ """
6
+
7
+ import config
8
+ from openai import OpenAI
9
+
10
+ cqe_prompt_a = "You are asked to provide a comprehensive list of competency "\
11
+ "questions describing all the possible requirements that can be "\
12
+ "addressed by the ontology described before."
13
+
14
+ cqt_prompt_a = "You are asked to infer if the ontology described before can "\
15
+ "address the following competency question: \"{}\" "\
16
+ "Valid answers are: Yes, No."
17
+
18
+
19
+ class ChatInterface:
20
+
21
+ def __init__(self,
22
+ api_key: str,
23
+ model_name: str = config.DEFAULT_MODEL,
24
+ sampling_seed: int = config.DEFAULT_SEED,
25
+ temperature: int = config.DEFAULT_TEMPERATURE):
26
+ # Save client configuration for all calls
27
+ self.client = OpenAI(api_key=api_key)
28
+ self.model_name = model_name
29
+ self.sampling_seed = sampling_seed
30
+ self.temperature = temperature
31
+
32
+ def chat_completion(self, messages, **kwargs):
33
+
34
+ model = kwargs["model"] if "model" in kwargs else self.model_name
35
+ temperature = kwargs["temperature"] if "temperature" in kwargs \
36
+ else self.temperature # this do not alter the class defaults
37
+
38
+ completion = self.client.chat.completions.create(
39
+ model=model,
40
+ messages=messages,
41
+ seed=self.sampling_seed,
42
+ temperature=temperature,
43
+ )
44
+ return completion.choices[0].message.content
45
+
46
+
47
+ def extract_competency_questions(onto_verbalisation: str,
48
+ chat_interface: ChatInterface,
49
+ prompt: str = cqe_prompt_a):
50
+ """
51
+ Extract competency questions from the verbalisation of an ontology.
52
+
53
+ Parameters
54
+ ----------
55
+ onto_verbalisation : str
56
+ A string expressing the ontology verbalisation as output from a
57
+ supported method in the `verbaliser` module.
58
+ chat_interface : ChatInterface
59
+ An instance of a chat interface holding the API session.
60
+ prompt : str, optional
61
+ CQ extraction prompt, by default cqe_prompt_a
62
+
63
+ Returns
64
+ -------
65
+ competency_questions : str
66
+ A list of competency questions induced from the verbalisation.
67
+
68
+ """
69
+ full_prompt = onto_verbalisation + "\n" + prompt
70
+ conversation_history = [
71
+ {"role": "system", "content": "You are an ontology expert."},
72
+ {"role": "user", "content": full_prompt}
73
+ ]
74
+
75
+ competency_questions = chat_interface.chat_completion(
76
+ conversation_history, model="gpt-3.5-turbo-16k")
77
+
78
+ return competency_questions
79
+
80
+
81
+ def test_competency_questions(onto_verbalisation: str,
82
+ competency_questions: list[str],
83
+ chat_interface: ChatInterface,
84
+ cq_prompt: str = cqt_prompt_a):
85
+ """
86
+ Performs a preliminary test of the ontology to assess whether its
87
+ verbalisation allows for addressing each competency questions given.
88
+
89
+ Parameters
90
+ ----------
91
+ onto_verbalisation : str
92
+ A string expressing the ontology verbalisation as output from a
93
+ supported method in the `verbaliser` module.
94
+ competency_questions: list[str]
95
+ A list of competency questions to use for preliminary testing.
96
+ chat_interface : ChatInterface
97
+ An instance of a chat interface holding the API session.
98
+ cq_prompt : str, optional
99
+ CQ test prompt, by default cqt_prompt_a
100
+
101
+ Returns
102
+ -------
103
+ cq_test_dict : dict
104
+ A dictionary holding an outcome (yes/no) as a preliminary test of each
105
+ competency question. Keys correspond to CQs.
106
+
107
+ """
108
+ cq_test_dict = {}
109
+ for cq in competency_questions:
110
+ full_prompt = onto_verbalisation + "\n" + cq_prompt.format(cq)
111
+ conversation_history = [
112
+ {"role": "system", "content": "You are an ontology engineer."},
113
+ {"role": "user", "content": full_prompt}
114
+ ]
115
+ outcome = chat_interface.chat_completion(
116
+ conversation_history, model="gpt-3.5-turbo-16k")
117
+ cq_test_dict[cq] = outcome
118
+
119
+ return cq_test_dict
ontochat/tutorial.ipynb ADDED
@@ -0,0 +1,364 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "%load_ext autoreload\n",
10
+ "%autoreload 2"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 2,
16
+ "metadata": {},
17
+ "outputs": [],
18
+ "source": []
19
+ },
20
+ {
21
+ "cell_type": "code",
22
+ "execution_count": 4,
23
+ "metadata": {},
24
+ "outputs": [],
25
+ "source": [
26
+ "from utils import read_key\n",
27
+ "\n",
28
+ "API_KEY = read_key(\"key.txt\")\n",
29
+ "# API_KEY = \"\" # or paste it here"
30
+ ]
31
+ },
32
+ {
33
+ "cell_type": "markdown",
34
+ "metadata": {},
35
+ "source": [
36
+ "# OntoChat API tutorial"
37
+ ]
38
+ },
39
+ {
40
+ "cell_type": "markdown",
41
+ "metadata": {},
42
+ "source": [
43
+ "## Story creation"
44
+ ]
45
+ },
46
+ {
47
+ "cell_type": "code",
48
+ "execution_count": null,
49
+ "metadata": {},
50
+ "outputs": [],
51
+ "source": []
52
+ },
53
+ {
54
+ "cell_type": "markdown",
55
+ "metadata": {},
56
+ "source": [
57
+ "## CQ extraction"
58
+ ]
59
+ },
60
+ {
61
+ "cell_type": "code",
62
+ "execution_count": null,
63
+ "metadata": {},
64
+ "outputs": [],
65
+ "source": []
66
+ },
67
+ {
68
+ "cell_type": "markdown",
69
+ "metadata": {},
70
+ "source": [
71
+ "## CQ analysis"
72
+ ]
73
+ },
74
+ {
75
+ "cell_type": "code",
76
+ "execution_count": null,
77
+ "metadata": {},
78
+ "outputs": [],
79
+ "source": []
80
+ },
81
+ {
82
+ "cell_type": "markdown",
83
+ "metadata": {},
84
+ "source": [
85
+ "## Ontology pre-testing"
86
+ ]
87
+ },
88
+ {
89
+ "cell_type": "code",
90
+ "execution_count": 3,
91
+ "metadata": {},
92
+ "outputs": [],
93
+ "source": [
94
+ "from ontolib import ChatInterface\n",
95
+ "\n",
96
+ "interface = ChatInterface(api_key=API_KEY)"
97
+ ]
98
+ },
99
+ {
100
+ "cell_type": "code",
101
+ "execution_count": 4,
102
+ "metadata": {},
103
+ "outputs": [],
104
+ "source": [
105
+ "from verbaliser import verbalise_ontology\n",
106
+ "\n",
107
+ "ontology_path = \"../../idea/data/samples/musicmeta.owl\"\n",
108
+ "\n",
109
+ "onto_about = \"music metadata\"\n",
110
+ "onto_desc = \"The ontology is supposed to describe music metadata related to \"\\\n",
111
+ " \"artists, compositions, performances, and recordings.\""
112
+ ]
113
+ },
114
+ {
115
+ "cell_type": "code",
116
+ "execution_count": 5,
117
+ "metadata": {},
118
+ "outputs": [],
119
+ "source": [
120
+ "verb = verbalise_ontology(ontology_path, onto_about, onto_desc)"
121
+ ]
122
+ },
123
+ {
124
+ "cell_type": "code",
125
+ "execution_count": 6,
126
+ "metadata": {},
127
+ "outputs": [
128
+ {
129
+ "name": "stdout",
130
+ "output_type": "stream",
131
+ "text": [
132
+ "Ontology description: music metadata. The ontology is supposed to describe music metadata related to artists, compositions, performances, and recordings.\n",
133
+ "The main classes of the ontology are listed below:\n",
134
+ "- Abstract Score: An abstract concept that allows to refer to the actual musical content of a MusicEntity. This makes it possible to describe musical properties that imply the existence of a hypothetical score, which may not be necessarily, or formally, materialised by the creators of the musical entity.\n",
135
+ "- Annotation Method: An annotation method refers to the nature of the procedure used for producing annotation on an artifact.\n",
136
+ "- Award: An award is intended as a recognition for a creative outcome, or more generally, for an activity carried out over a period of time. Typically, an award is given by an organisation and follows a recurring event.\n",
137
+ "- Broadcaster (subconcept of Agent): A class representing an entity or organization involved in broadcasting or transmitting audio or video content, including music.\n",
138
+ "- Broadcasting Situation (subconcept of Situation): Represents a specific situation or context related to broadcasting activities. It encompasses various scenarios, conditions, or events that may impact the broadcast of music or other content. It can include properties such as location, time, and specific conditions.\n",
139
+ "- Collection: A curated or organized grouping of musical works or related entities. It encompasses a cohesive set of musical compositions, recordings, scores, or other music-related items that are brought together based on a specific theme, genre, artist, or any other organizing principle.\n",
140
+ "- Collection Concept: An abstract or conceptual grouping of musical works or related entities. It encompasses a conceptual framework or idea that serves as the basis for organizing and categorizing musical compositions, recordings, scores, or other music-related items.\n",
141
+ "- Composition Part: A distinct section or segment of a musical composition. It encompasses the individual components or sections that make up a larger musical work, such as movements, sections, verses, choruses, or any other identifiable divisions within the composition.\n",
142
+ "- Creative Action: An action or process involving creativity, imagination, and artistic expression. It encompasses activities related to the creation, production, or development of artistic works, including music. It can include properties such as creator, medium, and result.\n",
143
+ "- Creative Process: Describes a series of actions, steps, or stages involved in the creative development or production of artistic works, including music. It encompasses the process of generating ideas, exploring concepts, refining techniques, and producing the final creative output. It can include properties such as participants, duration, and output.\n",
144
+ "- Creative Task (subconcept of Task): A task or assignment involving creative activities in the context of music. It encompasses various activities that require artistic expression, innovation, and imagination to create or develop musical works, performances, compositions, or other creative endeavors.\n",
145
+ "- Dedication Statement: A statement or expression of dedication, typically found in music albums, books, or other creative works. It is a declaration of gratitude, acknowledgment, or special recognition towards individuals, groups, or causes. It can include properties such as text, creator, and recipient.\n",
146
+ "- DigitalScore (subconcept of Score): A digital or electronic version of a musical score. It encompasses the digital representation of musical notation, allowing for electronic distribution, display, and manipulation of the score.\n",
147
+ "- Form Type: The type or structure of a musical composition. It encompasses the various standardized or recognized forms and structures that compositions can adopt, providing a framework for understanding and categorizing musical works based on their organizational patterns.\n",
148
+ "- Instrumentation: The arrangement or combination of musical instruments used in a composition, performance, or recording. It describes the specific instruments, their roles, and how they interact to create the overall sound and texture of the music. It can include properties such as instruments used, roles, and techniques.\n",
149
+ "- Key: The tonal center or tonic pitch of a musical composition. It denotes the specific pitch or note around which the composition revolves and provides a framework for harmonic and melodic relationships within the piece. It can include properties such as tonic pitch, mode, and related scales.\n",
150
+ "- Libretto (subconcept of Text): The written text or script of an opera, oratorio, or other dramatic musical work. The libretto serves as the literary foundation for the performance, providing the dialogue, lyrics, and stage directions that guide the singers, actors, and production team.\n",
151
+ "- License: The legal agreement or permission governing the usage and distribution of a musical work or its associated components. It encompasses the terms and conditions under which the music is licensed, including the rights granted, restrictions imposed, and obligations of the licensee.\n",
152
+ "- Live Performance (subconcept of Musical Performance): A musical performance that takes place in real-time and is witnessed by an audience. It encompasses the act of performing music in a live setting, such as a concert, recital, or music festival, where the performers and audience interact directly.\n",
153
+ "- Lyrics (subconcept of Text): The textual component of a musical composition that consists of the words, verses, or poetic expressions sung or spoken during the performance. Lyrics provide the vocal content and convey the narrative, emotions, or messages expressed through the music. They encompass the written representation of the lyrical content, which may be organized into lines, stanzas, or verses, forming an integral part of the composition.\n",
154
+ "- Medium of Performance: The specific ensemble, group, or combination of instruments or voices used in a musical performance or recording. It describes the medium through which the musical composition is interpreted and brought to life.\n",
155
+ "- Mode: A specific musical mode, which is a set of pitch relationships and tonal characteristics that define a particular scale and tonal center. It describes the arrangement of intervals and patterns of pitches used in a musical composition or performance.\n",
156
+ "- Movement (subconcept of Composition Part): A self-contained section within a larger musical composition, typically found in multi-movement works such as symphonies, sonatas, or concertos. It encompasses a distinct and coherent portion of the composition that is characterized by its own unique musical ideas, structure, and expression.\n",
157
+ "- Music Algorithm (subconcept of Music Artist): An algorithm or computational process used in the creation, analysis, or manipulation of music. It encompasses algorithms designed to generate musical compositions, analyze musical patterns, apply effects or transformations to audio, or perform other computational tasks related to music.\n",
158
+ "- Music Annotation Time Interval: A specific interval or duration within a musical composition that is annotated or marked with additional information.\n",
159
+ "- Music Artist: An individual or group involved in creating, performing, or producing music. It encompasses musicians, singers, bands, composers, conductors, producers, and other artistic entities within the music industry.\n",
160
+ "- Music Ensamble Membership: The membership of a musician in a music ensemble. It captures the association between a musician and a specific ensemble, indicating that the musician is a member of the ensemble.\n",
161
+ "- Music Ensenble (subconcept of Music Artist): A group or collective of musicians who perform together as an ensemble. It encompasses various types of musical groups, such as orchestras, bands, choirs, chamber ensembles, and jazz ensembles.\n",
162
+ "- Music Entity (subconcept of InformationObject): This class represents an Information Object, which is defined as the sum of all the elements that make up a piece of music. A music entity abstract a musical work, as it may results from a composition process, an improvisation, or be the result of non-written transmission.\n",
163
+ "- Music Genre: A specific category or classification of music that shares common characteristics, styles, or cultural origins. It encompasses distinct musical traditions, styles, or movements that define a particular genre.\n",
164
+ "- Music Sheet (subconcept of Score): A physical or printed document that contains the musical notation of a composition. It encompasses the sheet music, which provides a visual representation of the music, including notes, rhythms, lyrics, and other musical symbols.\n",
165
+ "- Musical Performance (subconcept of InformationRealization, Creative Process): A live or recorded rendition of a musical composition. It encompasses the act of performing music, whether by musicians, singers, or other performers, to convey the intended artistic expression and interpretation of the composition.\n",
166
+ "- Musician (subconcept of Music Artist, Person): An individual who is skilled in playing a musical instrument, singing, or composing music. It encompasses instrumentalists, vocalists, composers, conductors, and other individuals actively engaged in the creation, performance, or production of music.\n",
167
+ "- Note\n",
168
+ "- Opus Stantement: A statement or declaration related to a musical opus or composition. It is typically used to provide information about the creation, purpose, or significance of a specific musical work.\n",
169
+ "- Publication Situation (subconcept of Situation): Descibes the situation or context in which a musical work or recording is published or made publicly available. A PublicationSituation encompasses various aspects related to the publication of music, including the timing, location, medium, format, and associated entities involved in the publication process.\n",
170
+ "- Publisher (subconcept of Agent): An entity or organization responsible for publishing or distributing musical works, scores, recordings, or other music-related content. It encompasses companies, labels, or individuals that handle the production, promotion, and dissemination of music to the public.\n",
171
+ "- Recording: A recorded performance or rendition of a musical composition. It refers to the capturing of sound, whether in a studio or live setting, for the purpose of creating a permanent audio representation of a musical performance.\n",
172
+ "- Recording Equipment: The equipment and tools used in the process of recording music. It encompasses the various devices, instruments, and technologies employed to capture and produce high-quality audio recordings.\n",
173
+ "- Recording Process (subconcept of Creative Process): The process of capturing and creating a recorded version of a musical performance or composition. It encompasses the various stages and techniques involved in recording, editing, mixing, and mastering the audio to produce a finalized recording.\n",
174
+ "- Release: The distribution and availability of a recorded musical work to the public. It encompasses the act of officially making a recorded music product, such as an album or single, available for purchase, streaming, or other forms of consumption.\n",
175
+ "- Score: A written, printed or digital document that contains the musical notation of a composition. It encompasses the musical score, which serves as a visual representation of the music, including the arrangement of notes, rhythms, dynamics, and other musical symbols.\n",
176
+ "- Score Part: A specific part or section within a musical score. It refers to a distinct musical line or voice within a composition that is intended to be performed by a particular instrument or group of instruments.\n",
177
+ "- Section (subconcept of Composition Part): A distinct and identifiable segment within a musical composition. It encompasses smaller divisions within a composition that contribute to its overall structure, such as verses, choruses, bridges, or any other delineated portions of the music.\n",
178
+ "- Studio Performance (subconcept of Musical Performance): A musical performance that takes place in a recording studio or controlled environment specifically designed for audio recording. It encompasses the act of performing music with the purpose of capturing high-quality audio for later production, mixing, and mastering.\n",
179
+ "- Text: A written or textual component of a musical composition. It encompasses the textual elements, such as lyrics or libretto, that accompany or form part of a musical work.\n",
180
+ "- Text Fragment: A fragment or excerpt of text within a larger textual component of a musical composition. It encapsulates a specific portion of the lyrics, libretto, or other textual elements associated with the music. A TextFragment provides a smaller unit of textual content that can be individually referenced or analyzed within the context of the composition.\n",
181
+ "\n",
182
+ "The main named entities (individuals) are listed below:\n",
183
+ "- hasSource The domain of this relation can be: Text. The range of this relation can be: Text.\n",
184
+ "- isDerivedFrom The domain of this relation can be: Music Entity. The range of this relation can be: Music Entity.\n",
185
+ "- Creates: Represents the relationship between a CreativeProcess and the MusicEntity that is produced or brought into existence as a result of the process. It indicates that the CreativeProcess is responsible for generating, composing, producing, or otherwise creating the mentioned MusicEntity. The domain of this relation can be: Creative Process. The range of this relation can be: Music Entity.\n",
186
+ "- Has broadcaster: Specifies that a BroadcastingSituation involves a specific Broadcaster. This property represents the relationship between a broadcasting situation and the entity responsible for the broadcasting. It indicates that the mentioned BroadcastingSituation is associated with the mentioned Broadcaster, who is responsible for transmitting or airing the content. The domain of this relation can be: Broadcasting Situation. The range of this relation can be: Broadcaster.\n",
187
+ "- Has collaborated with: Specifies that a MusicArtist has collaborated with another MusicArtist. This property represents the relationship between two MusicArtists who have worked together on a musical project or performance. It indicates that the MusicArtist has engaged in a collaborative effort with the mentioned MusicArtist, indicating a shared creative endeavor, joint performance, or joint contribution to a musical work. The domain of this relation can be: Music Artist. The range of this relation can be: Music Artist.\n",
188
+ "- Has composition part (subproperty of hasPart): Represents the relationship between an AbstractScore and its constituent CompositionParts, such as Movements or Sections. It signifies that the AbstractScore includes or comprises the mentioned CompositionPart, which can be a distinct musical section, movement, or other structural elements within the composition. The domain of this relation can be: Abstract Score. The range of this relation can be: Composition Part.\n",
189
+ "- Has dedication statement The domain of this relation can be: Music Entity. The range of this relation can be: Dedication Statement.\n",
190
+ "- Has equipment: Specifies that a RecordingProcess involves a specific RecordingEquipment. This property represents the relationship between a RecordingProcess and the equipment used in the recording process. It indicates that the mentioned RecordingProcess utilizes the mentioned RecordingEquipment for capturing or producing the recorded content. The domain of this relation can be: Recording Process. The range of this relation can be: Recording Equipment.\n",
191
+ "- Has form type: Indicates that an AbstractScore has a specific FormType associated with it. This property represents the relationship between an AbstractScore and its designated FormType, which categorizes the overall structure or musical form of the composition. It signifies that the AbstractScore conforms to the mentioned FormType, which could include classifications such as Sonata, Symphony, Concerto, or other recognized musical forms. The domain of this relation can be: Abstract Score. The range of this relation can be: Form Type.\n",
192
+ "- hasGenre: pecifies the genre or genres associated with a MusicArtist. This property represents the relationship between a MusicArtist and the MusicGenre(s) that are attributed or associated with their artistic output or musical style. It indicates the genre(s) that best describe the musical genre(s) or genres in which the MusicArtist operates or specializes. The domain of this relation can be: Music Artist. The range of this relation can be: Music Genre.\n",
193
+ "- Has instrumentation: Specifies that an AbstractScore has an Instrumentation associated with it. This property represents the relationship between an AbstractScore and its corresponding Instrumentation. It indicates that the AbstractScore is intended to be performed by the instruments or voices specified in the Instrumentation. The domain of this relation can be: Abstract Score. The range of this relation can be: Instrumentation.\n",
194
+ "- Has key: Specifies that an AbstractScore is composed or written in a particular Key. This property represents the relationship between an AbstractScore and the Key in which it is intended to be performed or understood. It indicates that the AbstractScore is structured or based on the mentioned Key, which defines the tonal center, pitch relationships, and overall harmonic framework of the musical composition. The domain of this relation can be: Abstract Score. The range of this relation can be: Key.\n",
195
+ "- Has license: Specifies that a Recording, Release, or Score is associated with a specific License. This property represents the relationship between a musical recording, a release of music, or a musical score, and the license that governs its usage and distribution. It indicates that the mentioned Recording, Release, or Score is subject to the terms and conditions defined by the mentioned License. The domain of this relation can be: Recording, or Release, or Score. The range of this relation can be: License.\n",
196
+ "- Has medium: Specifies that a ScorePart is performed using a specific MediumOfPerformance. This property represents the relationship between a ScorePart and the medium or instrument through which it is intended to be performed. It indicates that the ScorePart is designed or written for the mentioned MediumOfPerformance, which could include instruments, voices, or other performance mediums. The domain of this relation can be: Score Part. The range of this relation can be: Medium of Performance.\n",
197
+ "- Has mode\n",
198
+ "- Has music entity part (subproperty of hasPart): Specifies the relationship between a MusicEntity and its constituent parts or components. This property represents the connection between a MusicEntity and the individual parts or components that comprise it. It indicates that the MusicEntity is composed of or includes the mentioned parts, which may consist of specific sections, movements, instrumental or vocal parts, or other structural elements that contribute to the overall composition. The domain of this relation can be: Music Entity. The range of this relation can be: Abstract Score, or Instrumentation, or Music Entity, or Text.\n",
199
+ "- Has opus statement: Specifies that a MusicEntity has an OpusStatement associated with it. This property represents the relationship between a MusicEntity and its corresponding OpusStatement. It indicates that the MusicEntity is identified or labeled with a specific OpusStatement, which typically includes information such as the opus number, title, composer, and other relevant details related to the work's cataloging or classification. The domain of this relation can be: Music Entity. The range of this relation can be: Opus Stantement.\n",
200
+ "- Publication situation: Specifies that a Score or Recording is associated with a specific PublicationSituation. This property represents the relationship between a musical score or recording and the situation or context in which it is published or made publicly available. It indicates that the mentioned Score or Recording is subject to the conditions and circumstances defined by the mentioned PublicationSituation. The domain of this relation can be: Release, or Score. The range of this relation can be: Publication Situation.\n",
201
+ "- Has publisher: Specifies that a PublicationSituation involves a specific Publisher. This property represents the relationship between a publication situation and the entity or organization responsible for publishing the content. It indicates that the mentioned PublicationSituation is associated with the mentioned Publisher, who is responsible for releasing or making the content available to the public. The domain of this relation can be: Publication Situation. The range of this relation can be: Publisher.\n",
202
+ "- Has recording The domain of this relation can be: Music Entity. The range of this relation can be: Recording.\n",
203
+ "- Has score: Indicates that an Instrumentation is associated with a Score. This property represents the relationship between an Instrumentation and the Score that represents its musical notation. It signifies that the Instrumentation is accompanied by the mentioned Score, which provides the written or printed representation of the musical arrangement for the instruments or voices involved. The domain of this relation can be: Instrumentation. The range of this relation can be: Score.\n",
204
+ "- Has score part (subproperty of hasPart): Specifies that a Score includes a specific ScorePart. This property represents the relationship between a Score and its constituent ScoreParts, which are individual sections or components of the overall musical notation. It indicates that the Score comprises the mentioned ScorePart, which can represent a particular instrument's part, vocal line, or other segmented elements within the musical composition. The domain of this relation can be: Score. The range of this relation can be: Score Part.\n",
205
+ "- Has source The domain of this relation can be: Text. The range of this relation can be: Text.\n",
206
+ "- Has text: Specifies that an AbstractScore has associated Text. This property represents the relationship between an AbstractScore and the Text associated with it. It indicates that the AbstractScore contains or includes the mentioned Text, which provides additional textual information, instructions, or annotations related to the score. The domain of this relation can be: Abstract Score. The range of this relation can be: Text.\n",
207
+ "- Has text part (subproperty of hasPart): Specifies that a Text has a TextFragment associated with it. This property represents the relationship between a Text, such as lyrics or written text, and its corresponding TextFragment. It indicates that the Text contains or includes the mentioned TextFragment, which represents a portion or segment of the overall Text. The domain of this relation can be: Text. The range of this relation can be: Text Fragment.\n",
208
+ "- Involves creative action (subproperty of involves): Specifies that a CreativeProcess involves a CreativeAction. This property represents the relationship between a CreativeProcess and the CreativeAction that is part of or integral to the process. The domain of this relation can be: Creative Process. The range of this relation can be: Creative Action.\n",
209
+ "- Involves member of music ensemble (subproperty of involvesAgent): Specifies the involvement of a MusicArtist as a member of a MusicEnsemble. This property represents the relationship between a MusicEnsembleMembership and the MusicArtist who is actively involved or participates as a member of the ensemble. The domain of this relation can be: Music Ensamble Membership. The range of this relation can be: Music Artist.\n",
210
+ "- Involves music ensemble (subproperty of involvesAgent): Specifies the relationship between a MusicEnsembleMembership and a MusicEnsemble, indicating that the membership involves or includes the specified music ensemble. The domain of this relation can be: Music Ensamble Membership. The range of this relation can be: Music Ensenble.\n",
211
+ "- Is broadcasted in: Specifies that a Recording is broadcasted in a specific BroadcastingSituation. This property represents the relationship between a recorded musical content and the broadcasting situation in which it is aired or transmitted. It indicates that the mentioned Recording is made available to the public through the mentioned BroadcastingSituation. The domain of this relation can be: Recording. The range of this relation can be: Broadcasting Situation.\n",
212
+ "- Is broadcaster of: Inverse relationship of \"hasBroadcaster.\" It indicates that a Broadcaster is associated with a specific BroadcastingSituation. This property establishes the connection from the Broadcaster's perspective, indicating that they are responsible for broadcasting the content in the mentioned BroadcastingSituation. The domain of this relation can be: Broadcaster. The range of this relation can be: Broadcasting Situation.\n",
213
+ "- Is composition part of (subproperty of isPartOf): Inverse relationship of \"hasCompositionPart.\" It indicates that a CompositionPart, such as a Movement or Section, is a component or part of a specific AbstractScore. This property establishes the connection from the CompositionPart's perspective, indicating its membership or inclusion within the larger AbstractScore. The domain of this relation can be: Composition Part. The range of this relation can be: Abstract Score.\n",
214
+ "- Is created by: Inverse relationship of \"creates.\" It indicates that a MusicEntity is created by a specific CreativeProcess. This property establishes the connection from the MusicEntity's perspective, indicating the creative process that is responsible for the entity's generation, composition, production, or creation. The domain of this relation can be: Music Entity. The range of this relation can be: Creative Process.\n",
215
+ "- is dedicated to: Specifies that a DedicationStatement is dedicated to a specific Person. This property represents the relationship between a DedicationStatement, typically found in musical works, and the person or entity to whom the dedication is addressed. It indicates that the DedicationStatement is intended as a tribute or honor to the mentioned Person. The domain of this relation can be: Dedication Statement. The range of this relation can be: Person.\n",
216
+ "- Is equipment of: Inverse relationship of \"hasEquipment.\" It indicates that a RecordingEquipment is associated with a specific RecordingProcess. This property establishes the connection from the RecordingEquipment's perspective, indicating that it is the equipment used in the mentioned RecordingProcess. The domain of this relation can be: Recording Equipment. The range of this relation can be: Recording Process.\n",
217
+ "- Is form type of: Inverse relationship of \"hasFormType.\" It indicates that a FormType is associated with a specific AbstractScore. This property establishes the connection from the FormType's perspective, indicating that it characterizes the overall musical structure or form of the corresponding AbstractScore. The domain of this relation can be: Form Type. The range of this relation can be: Abstract Score.\n",
218
+ "- Is formation place of: Inverse relationship of \"wasFormedIn.\" Establishes the connection from the place's perspective, highlighting its significance as the location where the ensemble was formed or established. It provides information about the historical and geographical association between the place and the formation of music ensembles, emphasizing the role of the place in shaping the ensemble's origin and identity. The domain of this relation can be: Place. The range of this relation can be: Music Ensenble.\n",
219
+ "- Is genre of: Inverse relationship of \"hasGenre.\" It specifies that a MusicGenre is attributed or associated with a MusicArtist. The domain of this relation can be: Music Genre. The range of this relation can be: Music Artist.\n",
220
+ "- Is influenced by: Specifies that a MusicArtist is influenced by another MusicArtist. This property represents the relationship between a MusicArtist and the MusicArtist(s) who have had a significant impact on their artistic development or musical style. It indicates that the MusicArtist has been influenced by the ideas, techniques, or musical expressions of the mentioned MusicArtist(s), which have played a role in shaping their own musical approach or creative output. The domain of this relation can be: Music Artist. The range of this relation can be: Music Artist.\n",
221
+ "- Is instrumentation of: Inverse relationship of \"hasInstrumentation.\" It indicates that an Instrumentation is associated with a specific AbstractScore. This property establishes the connection from the Instrumentation's perspective, indicating that it is the specified instrumentation or vocal arrangement intended for the corresponding AbstractScore. The domain of this relation can be: Instrumentation. The range of this relation can be: Abstract Score.\n",
222
+ "- Is involved in creative process (subproperty of isInvolvedIn): Inverse relationship of \"involvesCreativeAction.\" It indicates that a CreativeAction is involved in a specific CreativeProcess. This property establishes the connection from the CreativeAction's perspective, indicating its active involvement or participation within the context of the CreativeProcess.\n",
223
+ "- Is key of: Inverse relationship of \"hasKey.\" It indicates that a Key is associated with a specific AbstractScore. This property establishes the connection from the Key's perspective, indicating that it is the key signature or tonal center assigned to the corresponding AbstractScore. The domain of this relation can be: Key. The range of this relation can be: Abstract Score.\n",
224
+ "- Is license of: Inverse relationship of \"hasLicense.\" It indicates that a License is associated with a specific Recording, Release, or Score. This property establishes the connection from the License's perspective, indicating that it governs the usage and distribution of the mentioned Recording, Release, or Score. The domain of this relation can be: License. The range of this relation can be: Recording, or Score, or Release.\n",
225
+ "- Is medium of: nverse relationship of \"hasMedium.\" It indicates that a MediumOfPerformance is associated with a specific ScorePart. This property establishes the connection from the MediumOfPerformance's perspective, indicating that it is the performance medium or instrument for which the mentioned ScorePart is intended. The domain of this relation can be: Medium of Performance. The range of this relation can be: Score Part.\n",
226
+ "- Is opus statement of: Inverse relationship of \"hasOpusStatement.\" It indicates that an OpusStatement is associated with a specific MusicEntity. This property establishes the connection from the OpusStatement's perspective, indicating that it is the statement or label attributed to a particular MusicEntity. The inverse property \"isOpusStatementOf\" allows for the modeling and description of the relationship between OpusStatements and the MusicEntities they pertain to, providing a means to identify and associate OpusStatements with their corresponding musical works. The domain of this relation can be: Opus Stantement. The range of this relation can be: Music Entity.\n",
227
+ "- Is part of music entity (subproperty of isPartOf): Inverse relationship of \"hasMusicEntityPart.\" It indicates that a MusicEntity part or component is part of a specific MusicEntity. This property establishes the connection from the MusicEntity part's perspective, indicating its inclusion or membership within the larger MusicEntity. The inverse property \"isPartOfMusicEntity\" allows for the modeling and description of the hierarchical or structural relationships between MusicEntity parts and the MusicEntities they belong to. The domain of this relation can be: Abstract Score, or Music Entity, or Text, or Instrumentation. The range of this relation can be: Music Entity.\n",
228
+ "- Is part of release (subproperty of isPartOf): Specifies that a Recording is part of a specific Release. This property represents the relationship between a recorded musical content and the larger release or collection in which it is included. It indicates that the mentioned Recording is a component or part of the mentioned Release. The domain of this relation can be: Recording. The range of this relation can be: Release.\n",
229
+ "- Is produced by recording process (subproperty of isRealizedBy): Inverse relationship of \"producesRecording.\" It indicates that a Recording is produced by a specific RecordingProcess. This property establishes the connection from the Recording's perspective, indicating that it is the result or output of the mentioned RecordingProcess. The domain of this relation can be: Recording. The range of this relation can be: Recording Process.\n",
230
+ "- Is publication situation of: Inverse relationship of \"hasPublicationSituation.\" It indicates that a PublicationSituation is associated with a specific Score or Recording. This property establishes the connection from the PublicationSituation's perspective, indicating that it defines the conditions and circumstances under which the mentioned Score or Recording is published or made publicly available. The domain of this relation can be: Publication Situation. The range of this relation can be: Recording, or Score.\n",
231
+ "- Is publisher of: Iverse relationship of \"hasPublisher.\" It indicates that a Publisher is associated with a specific PublicationSituation. This property establishes the connection from the Publisher's perspective, indicating that they are responsible for publishing the content in the mentioned PublicationSituation. The domain of this relation can be: Publisher. The range of this relation can be: Publication Situation.\n",
232
+ "- Is realisation of: Iverse relationship of \"isRealisedBy.\" It indicates that a Score or ScorePart is a realisation or tangible representation of a specific AbstractScore or Instrumentation. This property establishes the connection from the Score or ScorePart's perspective, indicating that it materializes or embodies the musical content or instrumentation described in the corresponding AbstractScore or Instrumentation. The domain of this relation can be: Score, or Score Part. The range of this relation can be: Abstract Score, or Instrumentation.\n",
233
+ "- Is realized by The domain of this relation can be: Music Entity. The range of this relation can be: Musical Performance.\n",
234
+ "- Is realised in: Represents the relationship between an AbstractScore or Instrumentation and the Score or ScorePart that brings it to life in a tangible or performable form. It signifies that the AbstractScore or Instrumentation is manifested or rendered into a concrete representation or performance through the mentioned Score or ScorePart. The domain of this relation can be: Abstract Score, or Instrumentation. The range of this relation can be: Score, or Score Part.\n",
235
+ "- Is recorded by: Specifies that a MusicEntity or MusicalPerformance is recorded through a RecordingProcess. This property represents the relationship between a MusicEntity or MusicalPerformance and the process of recording it, typically involving capturing the audio or video performance in a recorded format. The domain of this relation can be: Music Entity, or Musical Performance. The range of this relation can be: Recording Process.\n",
236
+ "- Is recording process of: Inverse relationship of \"isRecordedBy.\" It indicates that a RecordingProcess is associated with a specific MusicEntity or MusicalPerformance. This property establishes the connection from the RecordingProcess's perspective, indicating that it is the process responsible for capturing or documenting the mentioned MusicEntity or MusicalPerformance. The domain of this relation can be: Recording Process. The range of this relation can be: Music Entity, or Musical Performance.\n",
237
+ "- Is score of: Inverse relationship of \"hasScore.\" It indicates that a Score is associated with a specific Instrumentation. This property establishes the connection from the Score's perspective, indicating that it serves as the musical notation for the mentioned Instrumentation. The domain of this relation can be: Score. The range of this relation can be: Instrumentation.\n",
238
+ "- Is score part of (subproperty of isPartOf): Inverse relationship of \"hasScorePart.\" It indicates that a ScorePart is a component or part of a specific Score. This property establishes the connection from the ScorePart's perspective, indicating its membership or inclusion within the larger Score. The domain of this relation can be: Score Part. The range of this relation can be: Score.\n",
239
+ "- Is text fragment of (subproperty of isPartOf): Inverse relationship of \"hasTextFragment.\" It indicates that a TextFragment is associated with a specific Text. This property establishes the connection from the TextFragment's perspective, indicating that it is a fragment or segment of the larger Text. The domain of this relation can be: Text Fragment. The range of this relation can be: Text.\n",
240
+ "- Is text of: Inverse relationship of \"hasText.\" It indicates that a Text is associated with a specific AbstractScore. This property establishes the connection from the Text's perspective, indicating that it is the textual content or annotations specifically intended for the corresponding AbstractScore. The domain of this relation can be: Text. The range of this relation can be: Abstract Score.\n",
241
+ "- Is trained on: Specifies that a MusicAlgorithm has been trained on a specific MusicDataset. This property indicates the relationship between a MusicAlgorithm and the dataset it was trained on, highlighting the input data used to train and develop the algorithm's functionality and knowledge in the field of music. The domain of this relation can be: Music Algorithm. The range of this relation can be: MusicDataset.\n",
242
+ "- Is training of: Inverse relationship of \"isTrainedOn.\" It indicates that a specific MusicDataset is used as training data for a MusicAlgorithm. The inverse property establishes the connection from the dataset's perspective, highlighting its role in training and contributing to the development of the algorithm's functionality and knowledge in the field of music. The domain of this relation can be: MusicDataset. The range of this relation can be: Music Algorithm.\n",
243
+ "- Nominated for award: Represents the relationship between a MusicArtist and the Award for which they have received a nomination. It indicates that the MusicArtist has been recognized or considered for the Award, highlighting their achievement or recognition in the music industry. The domain of this relation can be: Music Artist. The range of this relation can be: Award.\n",
244
+ "- Produces recording: pecifies that a RecordingProcess produces a specific Recording. This property represents the relationship between a RecordingProcess and the resulting recorded output. It indicates that the mentioned RecordingProcess is responsible for the creation or production of the mentioned Recording. The domain of this relation can be: Recording Process. The range of this relation can be: Recording.\n",
245
+ "- Received award: Specifies that a MusicArtist has received a specific Award. It indicates that the MusicArtist has been honored or recognized with the mentioned Award, highlighting their achievement or excellence in the music industry. The domain of this relation can be: Music Artist. The range of this relation can be: Award.\n",
246
+ "- Was formed in: Specifies the relationship between a MusicEnsemble and a Place, indicating that the ensemble was formed or established in a particular location. This property highlights the geographical origin or location where the ensemble came into existence or was initially established, providing information about its place of formation. The domain of this relation can be: Music Ensenble. The range of this relation can be: Place.\n",
247
+ "\n",
248
+ "The main relations of the ontology are listed below:\n",
249
+ "- Instrumentation is an instance of class Creative Task.\n",
250
+ "- Lyrics writing is an instance of class Creative Task.\n",
251
+ "- Music Writing is an instance of class Creative Task.\n",
252
+ "- Orchestration is an instance of class Creative Task.\n",
253
+ "\n"
254
+ ]
255
+ }
256
+ ],
257
+ "source": [
258
+ "print(verb)"
259
+ ]
260
+ },
261
+ {
262
+ "cell_type": "code",
263
+ "execution_count": null,
264
+ "metadata": {},
265
+ "outputs": [],
266
+ "source": []
267
+ },
268
+ {
269
+ "cell_type": "markdown",
270
+ "metadata": {},
271
+ "source": [
272
+ "### Onto2CQ and CQ-pretest"
273
+ ]
274
+ },
275
+ {
276
+ "cell_type": "code",
277
+ "execution_count": null,
278
+ "metadata": {},
279
+ "outputs": [],
280
+ "source": [
281
+ "from ontolib import extract_competency_questions, test_competency_questions\n",
282
+ "\n",
283
+ "extracted_cqs = extract_competency_questions(\n",
284
+ " onto_verbalisation=verb,\n",
285
+ " chat_interface=interface)"
286
+ ]
287
+ },
288
+ {
289
+ "cell_type": "code",
290
+ "execution_count": 10,
291
+ "metadata": {},
292
+ "outputs": [],
293
+ "source": [
294
+ "# print(extracted_cqs)"
295
+ ]
296
+ },
297
+ {
298
+ "cell_type": "code",
299
+ "execution_count": 13,
300
+ "metadata": {},
301
+ "outputs": [],
302
+ "source": [
303
+ "cq_list = [\n",
304
+ " \"Who are the parents of a music artist?\",\n",
305
+ " \"Where did a music artist study?\",\n",
306
+ " \"What is the genre of a music entity?\",\n",
307
+ " \"Who are the authors of a music entity?\"]\n",
308
+ "\n",
309
+ "cq_dict = test_competency_questions(verb, cq_list, chat_interface=interface)"
310
+ ]
311
+ },
312
+ {
313
+ "cell_type": "code",
314
+ "execution_count": 14,
315
+ "metadata": {},
316
+ "outputs": [
317
+ {
318
+ "data": {
319
+ "text/plain": [
320
+ "{'Who are the parents of a music artist?': 'No',\n",
321
+ " 'Where did a music artist study?': 'No',\n",
322
+ " 'What is the genre of a music entity?': 'Yes',\n",
323
+ " 'Who are the authors of a music entity?': 'Yes'}"
324
+ ]
325
+ },
326
+ "execution_count": 14,
327
+ "metadata": {},
328
+ "output_type": "execute_result"
329
+ }
330
+ ],
331
+ "source": [
332
+ "cq_dict"
333
+ ]
334
+ },
335
+ {
336
+ "cell_type": "code",
337
+ "execution_count": null,
338
+ "metadata": {},
339
+ "outputs": [],
340
+ "source": []
341
+ }
342
+ ],
343
+ "metadata": {
344
+ "kernelspec": {
345
+ "display_name": "choco",
346
+ "language": "python",
347
+ "name": "python3"
348
+ },
349
+ "language_info": {
350
+ "codemirror_mode": {
351
+ "name": "ipython",
352
+ "version": 3
353
+ },
354
+ "file_extension": ".py",
355
+ "mimetype": "text/x-python",
356
+ "name": "python",
357
+ "nbconvert_exporter": "python",
358
+ "pygments_lexer": "ipython3",
359
+ "version": "3.11.4"
360
+ }
361
+ },
362
+ "nbformat": 4,
363
+ "nbformat_minor": 2
364
+ }
ontochat/utils.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ General-purpose utility functions.
3
+ """
4
+
5
+ def read_key(file_path: str = "key.txt"):
6
+ with open(file_path, "r") as fo:
7
+ key = fo.read()
8
+ return key
9
+