請更新您的查詢以使用兩種鏈結形式,並在使用標題或搜尋標題之前,將標題強制轉型為字串。您可以使用 SPARQL 內容路徑來比對數個替代方案。因此,您可以使用兩種替代方案的 UNION,或內容路徑(例如 prov:wasRevisionOf|dcterms:replaces)來比對 1.x 和 4.0.3 及更新版本表示法。
在產品定義中,如果版本資訊需要您識別特定的圖形,則內容路徑(例如 pd:view|^pd:isViewOf)不適用,因為兩種替代方案位在不同的圖形中。在此情況下,您必須使用 UNION。
如果您查詢其標題包含引號、'&' 符號或小於符號的產品,在 4.0.3 及更新版本的 XMLLiteral 表示法中,這些字元必須是 XML 編碼。
例如,下列查詢顯示其標題包含 "auto&boat" 字元的產品,舊版產品以及這些每一個產品的接近子項產品:
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pd: <http://jazz.net/ns/pd#>
PREFIX pd_ext: <http://jazz.net/ns/pd/extensions#>
SELECT ?parentVersion ?predecessor ?childVersion
WHERE
{
GRAPH ?parentVersion
{
?parent a pd:Item ;
?testcase dcterms:title ?title .
OPTIONAL { ?parent prov:wasRevisionOf|dcterms:replaces ?predecessor }
}
FILTER regex(str(?title),".*auto(&|&)boat.*","","i")
{
{ GRAPH ?parentVersion { ?parent pd:view ?view } }
UNION
{ ?view pd:isViewOf ?parentVersion }
}
OPTIONAL { ?view dcterms:hasPart/pd_ext:binding ?childVersion }
}
產品的 dcterms:identifier 現在是長唯一字串。如果可能, 請在查詢中使用不同的已知產品內容。否則,請將使用 dcterms:identifier 的查詢更新為使用新的 ID。
4.0.3 版編製有關產品分支的維度內容索引。例如,您可以將先前的查詢擴增為顯示母產品的維度(分支)資訊:
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pd: <http://jazz.net/ns/pd#>
PREFIX pd_ext: <http://jazz.net/ns/pd/extensions#>
SELECT ?parentVersion ?dtitle ?dvalue ?predecessor ?childVersion
WHERE
{
GRAPH ?parentVersion
{
?parent a pd:Item ;
?testcase dcterms:title ?title .
OPTIONAL { ?parent prov:wasRevisionOf|dcterms:replaces ?predecessor }
OPTIONAL { ?parent pd_ext:dimensions ?bn }
}
FILTER regex(str(?title),".*auto(&|&)boat.*","i")
{
{ GRAPH ?parentVersion { ?parent pd:view ?view } }
UNION
{ ?view pd:isViewOf ?parentVersion }
}
OPTIONAL { ?view dcterms:hasPart/pd_ext:binding ?childVersion }
?bn ?dimension ?dvalue .
?dimension dcterms:title ?dtitle .
}
在所有舊版中,索引表示使用者電子郵件位址的 URL 編碼不正確。例如,電子郵件位址 URI mailto:susan@example.com 在索引中表示為 mailto:susan%40example.com。這個問題已在 Jazz™ 4.0.3 中修正,但在 DOORS® 第 9 版中未修正。 因此,查詢必須允許這兩種格式的電子郵件位址:
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX oslc_cm: <http://open-services.net/ns/cm#>
SELECT ?cr ?title ?contribMbox
WHERE {
?cr a oslc_cm:ChangeRequest ;
dcterms:type "Task"^^xsd:string ;
dcterms:title ?title ;
dcterms:contributor/foaf:mbox ?contribMbox .
FILTER regex(str(?contribMbox),"susan(@|%40)example.com")
}