DDMAL / DDMAL/linkedmusic-queries

For NLQ "四川扬琴是否有代表性的曲目,这些曲目可能用到了哪些乐器?"(translated as "Does 'Sichuan Yangqin' have representative pieces, and what instruments might be used in these pieces?")--chatGPT cannot generate a perfect SPARQL

Open
#41 1 comment 0 reactions 1 assignee Claimed by @candlecao View on GitHub
medium
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

As for this question, the expected entities of OWL are:
`{ctm:MusicType ctm:PieceWithPerformance mo:Instrument}`
`{bf:instrument ctm:representativePiece ctm:samplePieceWithPerformance}`

Based on the extracted subgraph of ontology:
```
@prefix rdf: .
@prefix rdfs: .
@prefix owl: .
@prefix ns3: .
@prefix mo: .
@prefix ns5: .

### Classes ###
rdfs:Literal
rdf:type owl:Class .

mo:Instrument
rdf:type owl:Class ;
rdfs:label "乐器" .

ns3:MusicType
rdf:type owl:Class ;
rdfs:label "音乐类型(乐种)", "乐种" .

ns3:PieceWithPerformance
rdf:type owl:Class ;
rdfs:label "曲目", "演出的曲目", "曲目的演出" ;
rdfs:comment "对应二次创作,如以具体的表演行为表达的作品" .

### Object Properties ###
ns3:samplePieceWithPerformance
rdf:type owl:ObjectProperty ;
rdfs:label "示例曲目的演出" ;
rdfs:domain mo:Instrument , ns3:MusicType ;
rdfs:range ns3:PieceWithPerformance ;
rdfs:comment "关联一个乐器和它的代表曲目,或关联一个乐种和它的代表曲目", "关联一个乐器和它的代表曲目,或关联一个音乐类型(乐种)和它的代表曲目" .

ns3:piecePrincipalInstrument
rdf:type owl:ObjectProperty ;
rdfs:label "曲目的主奏乐器有" ;
rdfs:domain ns3:PieceWithPerformance ;
rdfs:range mo:Instrument ;
rdfs:comment "关联一个演出的曲目和它的主奏乐器。'曲目的主奏乐器有'这个属性有时候意义较为宽泛,如同'曲目的主要乐器有'" .

ns5:instrument
rdf:type owl:ObjectProperty ;
rdfs:label "曲目的演出使用…乐器" ;
rdfs:domain ns3:PieceWithPerformance ;
rdfs:range mo:Instrument ;
rdfs:comment "关联一部演出的曲目和其演出中使用的乐器" .

### Datatype Properties ###
ns3:representativePiece
rdf:type owl:DatatypeProperty ;
rdfs:label "有代表曲目或剧目" ;
rdfs:domain ns3:MusicType ;
rdfs:range rdfs:Literal ;
rdfs:comment "专指乐种或乐器的代表曲目(或剧目),一般用书名号表示(对于曲牌,则用半角中括号表示)" .

ns3:representativeQupai
rdf:type owl:DatatypeProperty ;
rdfs:label "有代表曲牌" ;
rdfs:domain ns3:MusicType ;
rdfs:range rdfs:Literal ;
rdfs:comment "指一个乐种或音乐类型的代表性曲牌" .

ns3:nameOfMusicTypeOrInstrument
rdf:type owl:DatatypeProperty ;
rdfs:label "音乐类型(乐种)或乐器的名称" ;
rdfs:domain mo:Instrument , ns3:MusicType ;
rdfs:range rdfs:Literal ;
rdfs:comment "指一个'音乐类型(乐种)'的名称,或指一个'乐器'的名称。而对这二者,其名称则不用rdfs:label来表示" .

```
ChatGPT generated a version of SPARQL:
```
PREFIX rdf:
PREFIX rdfs:
PREFIX owl:
PREFIX ns3:
PREFIX mo:
PREFIX ns5:

SELECT ?representativePiece ?instrument
WHERE {
# Find the music type "四川扬琴"(translated as "Sichuan Yangqin")
?musicType rdfs:label "四川扬琴" .

# Check if it has representative pieces
?musicType ns3:representativePiece ?representativePiece .

# Find instruments associated with the representative pieces
OPTIONAL {
?piece rdf:type ns3:PieceWithPerformance ;
rdfs:label ?representativePiece ;
ns5:instrument ?instrument .
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.