Final Project (group 19)
Minerals exhibit a diverse array of colours, which contribute to their uniqueness among geological specimens. These colours can vary from white, violet, and green to bright red, making each mineral distinct. In this respect we decided to interrogate ChatGPT through the technique of Generated Knowledge Prompting in the hope of confirming and expanding our knowledge about this particular characteristic of minerals.
The difference between the two answers lies in the format and detail of the explanation. The initial answer is a straightforward “no” with a brief explanation. The revised answer starts with “no” and provides a detailed explanation, including examples of the different colors quartz can exhibit and specifying that the violet variety is known as amethyst. The revised answer is more comprehensive and informative.
Then we decided to explore the DBpedia KG to find how the property of color is described in it:
After that we prompted ChatGPT again through the technique of Self-Consistency in order to find a property in ArCo which describes the color of a mineral. The answer is the following:
Given our uncertainty about the accuracy of the LLM’s response, we decided to enhance our search by prompting again the model with the same technique. Upon further investigation, we found that ChatGPT provided an incorrect answer. After thoroughly reviewing ArCo ontologies, it became clear that there is no property named arco:hasColour in the Knowledge Graph.
ChatGPT provided the same response as before, despite our knowledge that it was incorrect. After reviewing both the ArCo ontology and the Natural Specimen Description ontology on ArCo website, we were unable to find properties related to colour. However, in the Denotative Description ontology, we discovered the property hasColour.
Afterwards we run the following query on ChatGPT:
PREFIX arco: <https://w3id.org/arco/ontology/arco/>
PREFIX arco-cd: <https://w3id.org/arco/ontology/context-description/>
PREFIX arco-des: <https://w3id.org/arco/ontology/description/>
SELECT ?mineral ?color
WHERE {
VALUES ?mineralName {"Quartz" "Topaz"}
?mineral a arco-cd:Mineral ;
arco-des:hasName ?mineralName ;
arco-des:hasColor ?color .
}
Since the above query does not give any result, we tried to modify it. By doing so, we made some considerations:
PREFIX dd: <https://w3id.org/arco/ontology/denotative-description/>
PREFIX spe: <https://w3id.org/arco/ontology/natural-specimen-description/>
SELECT DISTINCT ?mineral ?colour
WHERE {
?mineral a spe:Mineral ;
rdfs:label ?mineralLabel ;
dd:hasColour ?colour .
{FILTER(REGEX(?mineralLabel, "quartz", "i"))}
UNION
{FILTER(REGEX(?mineralLabel, "topaz", "i"))}
}
Below, we present our investigation using the few-shot technique with ChatGPT to determine whether the query above is correct. The model provided some suggestions for improving the syntax:
The suggested correction is the following:
PREFIX dd: <https://w3id.org/arco/ontology/denotative-description/>
PREFIX spe: <https://w3id.org/arco/ontology/natural-specimen-description/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?mineral ?colour
WHERE {
?mineral a spe:Mineral ;
rdfs:label ?mineralLabel ;
dd:hasColour ?colour .
FILTER(REGEX(?mineralLabel, "quartz", "i") || REGEX(?mineralLabel, "topaz", "i"))
}
However explicative and detailed the description provided by the LLM is, this query does not give results. We now create a query to find the subject of the property hasColour:
PREFIX a-dd: <https://w3id.org/arco/ontology/denotative-description/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?subject ?subjectLabel ?colour ?colourLabel
WHERE {
?subject a-dd:hasColour ?colour;
rdfs:label ?subjectLabel .
?colour rdfs:label ?colourLabel
FILTER(REGEX(?subjectLabel, "zircone", "i"))
}
ORDER BY ASC (?subjectLabel)
LIMIT 200
The results of the query are shown in the table below. It should be noticed that all the property values under the column “colour” are identified by the class Technical Characteristic, which is more appropriate for colour than for names of minerals (see the results of a query about zircon’s IRI in the section “Chemical Formula”)
We can now write a new triple connecting the first entity of the table labeled “zircone (esemplare)” with the colour label “celeste”:
NEW TRIPLE 3
This is the same query as the previous one but instead of “zircone” we used “topazio”:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX a-dd: <https://w3id.org/arco/ontology/denotative-description/>
SELECT DISTINCT ?subject ?subjectLabel ?colour ?colourLabel
WHERE {
?subject a-dd:hasColour ?colour;
rdfs:label ?subjectLabel .
?colour rdfs:label ?colourLabel
FILTER(REGEX(?subjectLabel, "topazio", "i"))
}
ORDER BY ASC (?subjectLabel)
LIMIT 200
In order to create the next triple we chose the first result of the table connected to the value “giallo vinato”:
NEW TRIPLE 4