Evan Lalo
Evan Lalo

Reputation: 1273

Fuseki SPARQL Query: Regex not finding existing literal

I am trying to return a node based on a regex query.

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

I have a node with named Products:442A30. It has the following attributes.

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" ;

Unless I am mistaken, both of my query parameters are being met. Despite this, the node above is not returned. Instead, I get Products:442A30VP and Products:442B30VP.

Thanks!

Upvotes: 0

Views: 105

Answers (1)

nnamdi
nnamdi

Reputation: 101

Change your filter to filter ( regex (?p, "^442.*"))

Upvotes: 1

Related Questions