1

我想爬取 100 页 wikipedia ,所以我想每次将 wikiPageID 增加 1。我该怎么做?

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT  * WHERE {
?saket dbo:wikiPageID 57570.
?saket foaf:isPrimaryTopicOf ?wikilink.  

       OPTIONAL {
            ?saket dbp:birthPlace ?birth.}
       OPTIONAL {
            ?saket dbp:dateOfBirth ?dob.}
       OPTIONAL{
            ?saket dbp:nationality ?country.}
       OPTIONAL{
            ?saket dbp:occupation  ?occupation.}

}
4

1 回答 1

2
   PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

   SELECT  * WHERE {
   ?saket dbo:wikiPageID ?id .
   ?saket foaf:isPrimaryTopicOf ?wikilink.  
   FILTER(?id >= 100 && ?id < 200)

   OPTIONAL {
        ?saket dbp:birthPlace ?birth.}
   OPTIONAL {
        ?saket dbp:dateOfBirth ?dob.}
   OPTIONAL{
        ?saket dbp:nationality ?country.}
   OPTIONAL{
        ?saket dbp:occupation  ?occupation.}
   }
于 2016-06-01T13:20:01.877 回答