Sparql - Applying limiting criteria to predicates

后端 未结 2 2055
暖寄归人
暖寄归人 2020-12-21 07:32

I\'m fairly new to RDF / Sparql, so apologies for any incorrect terminology, and also for the fairly terrible example that follows:

Given the following RDF dataset:<

2条回答
  •  無奈伤痛
    2020-12-21 08:00

    I don't know the solution in pure SPARQL, sorry. In OpenLink Virtuoso's SPARQL-BI, the solution is this query

    prefix e: 
    prefix foaf:  
    select * 
    where
      {
        { select ?orig ?target 
          where
           { ?orig   foaf:knows ?target . 
             ?target a          e:Freemason .
           } 
        } 
        option ( TRANSITIVE, 
                 T_IN(?orig), 
                 T_OUT(?target), 
                 T_DISTINCT, 
                 T_MIN(1)
               )
        filter ( ?orig =  )
      }
    

    -- with these results --

    orig                               target
        
        
    

提交回复
热议问题