Fuseki SPARQL查询:正则表达式找不到现有的文字

时间:2018-04-04 18:50:47

标签: regex sparql

我正在尝试根据正则表达式查询返回一个节点。

select ?s ?p where {  
    ?s a Products:Style .
    ?s Products:PartNumber ?p .
    filter ( regex (?p, "^442A")) 
}

我有一个名为Products的节点:442A30。它具有以下属性。

Products:442A30  a                    <http://www.w3.org/2002/07/owl#NamedIndividual> , Products:Style ;
        rdfs:label                    "Gesture; Chair, Upholstered ;
        Products:AltDescription       "Gesture;Chair,Uph,Adj seat D" ;
        Products:BasePrice            "1,241.00" ;
        Products:ClassNoun            "Chair" ;
        Products:HasComponent         Products:P442_WORK_1 ;
        Products:HasServicePart       Products:4652510SR ;
        Products:LongDescription      "Gesture; Chair, Upholstered, Shell back, Adjustable seat depth" ;
        Products:PartNumber           "442A30" ;
        Products:ProductLine          Products:442_GESTURE ;
        Products:ShortDescription     "Gesture;Chair,Uph,Shl bk,Adj seat D" ;
        Products:StyleFeature         "Shell back" , "Adjustable seat depth" ;
        Products:StyleMaterial        "Upholstered" ;

除非我弄错了,否则我的两个查询参数都会被满足。尽管如此,上面的节点不会被返回。相反,我得到Products:442A30VPProducts:442B30VP

谢谢!

1 个答案:

答案 0 :(得分:1)

将过滤器更改为filter ( regex (?p, "^442.*"))