query doesn't work

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

query doesn't work

Pakbi
Hi guys, the queries doesn't work.

with onto3:
           class farmaco(Thing):
              pass
           for i in farmaco.direct_instances():
              querys = list(my_world.sparql('''PREFIX onto: <http://test.org/codifa.owl#>
                                       SELECT ?q { onto:''' + i.name + ''' onto:contiene ?q
                                       ?q onto:interazione onto:''' + PA + ''' .}'''))
           for y in querys:
              print(y)
              controllo1 = 1
              querys2 = list(my_world.sparql('''PREFIX onto: <http://test.org/codifa.owl#>
                                          SELECT ?q { ?q onto:contiene onto:'''+ y + ''' .}'''))
              for yy in querys2:
                 print(yy)
                 farmaci_incompatibili.append(yy)
Reply | Threaded
Open this post in threaded view
|

Re: query doesn't work

Jiba
Administrator
Hi,

In the first query, you need a "." to separate the two triples,  just after the first "?q".

Jiba