web scraping - Can SPARQL handle blank results for specific cells? -
i writing sparql query , cant figure out how allow blank results specific columns.
my current request is:
select * { ?game dbpedia-owl:game ; dbpprop:name ?name ; dbpedia-owl:publisher ?publisher . }
some games have owl publisher while others not. above request filters out games not have publisher. want able games publisher , games without publisher in same csv.
i tried write if isset statements publisher owl cannot seem correct blanks.
instead of filtering out games without publisher, want result blank publisher cell.
any suggestions?
whenever looking might , might not present, can put part of statement in optional
part of sparql query. thus:
select * { ?game dbpedia-owl:game ; dbpprop:name ?name . optional{ ?game dbpedia-owl:publisher ?publisher . } }
the count before optional 112 , after 143.
Comments
Post a Comment