从维基百科中的某个框中获取所有dbpprop

Let me use these 2 links as my examples: http://en.wikipedia.org/wiki/Maarten_Stekelenburg http://dbpedia.org/page/Maarten_Stekelenburg

What I want to do is get all the dbpprops which are in the top right infobox (the one with the picture). Here I encounter 2 problems:

  • How do I get all the properties without knowing them (We are putting together a football player database, and the prop names are all different for every player)

  • How do I make sure those are the properties that are inside the box, because there are many other dbpprops on that page and it doesn't look like dbpedia differentiates between those.

After that I want to add all those properties to an array(if that is possible). If it's possible, I would like it to look something like this:

PREFIX dbp: <http://dbpedia.org/resource/>
PREFIX dbp2: <http://dbpedia.org/ontology/>
PREFIX dbp3: <http://dbpedia.org/property/>

SELECT *
WHERE {
  dbp:".$term." dbp2:abstract ?abstract .
  dbp:".$term." dbp2:thumbnail ?img .
  dbp:".$term." dbp3:* ?properties . //This would then be replaced by the necessary line
  FILTER langMatches(lang(?abstract), 'en')
}

EDIT: I am working with PHP

I can't guarantee that the set of properties from the infobox will be exactly the properties that are dbpprop properties (as opposed to dbpedia-owl properties), but it looks like there's a fairly good correspondence. In this case, you could use a query like the following which asks for properties and values of the person you mentioned, but only thoe properties that are in the dbpprop namespace.

prefix dbpedia: <http://dbpedia.org/resource/>
prefix dbpprop: <http://dbpedia.org/property/>

select ?property ?value where {
  dbpedia:Maarten_Stekelenburg ?property ?value
  filter( strstarts(str(?property),str(dbpprop:)) )
}

SPARQL results

----------------------------------------------------------------------------------------------------------------------
| property                   | value                                                                                 |
======================================================================================================================
| dbpprop:bg                 | "gold"@en                                                                             |
| dbpprop:bg                 | "#F1771D"@en                                                                          |
| dbpprop:birthDate          | "1982-09-21+02:00"^^<http://www.w3.org/2001/XMLSchema#date>                           |
| dbpprop:birthPlace         | "Haarlem, Netherlands"@en                                                             |
| dbpprop:caps               | 44                                                                                    |
| dbpprop:caps               | 191                                                                                   |
| dbpprop:clubnumber         | 24                                                                                    |
| dbpprop:clubs              | dbpedia:A.S._Roma                                                                     |
| dbpprop:clubs              | dbpedia:AFC_Ajax                                                                      |
| dbpprop:currentclub        | dbpedia:A.S._Roma                                                                     |
| dbpprop:dateOfBirth        | 22                                                                                    |
| dbpprop:fg                 | "navy"@en                                                                             |
| dbpprop:fg                 | "white"@en                                                                            |
| dbpprop:fullname           | "Maarten Stekelenburg"@en                                                             |
| dbpprop:goals              | 0                                                                                     |
| dbpprop:name               | "Maarten Stekelenburg"@en                                                             |
| dbpprop:name               | "Stekelenburg, Maarten"@en                                                            |
| dbpprop:nationalcaps       | 4                                                                                     |
| dbpprop:nationalcaps       | 54                                                                                    |
| dbpprop:nationalgoals      | 0                                                                                     |
| dbpprop:nationalteam       | dbpedia:Netherlands_national_football_team                                            |
| dbpprop:nationalteam       | dbpedia:Netherlands_national_under-21_football_team                                   |
| dbpprop:nationalyears      | 2002                                                                                  |
| dbpprop:nationalyears      | 2004                                                                                  |
| dbpprop:ntupdate           | 18                                                                                    |
| dbpprop:pcupdate           | 21                                                                                    |
| dbpprop:placeOfBirth       | "Haarlem, Netherlands"@en                                                             |
| dbpprop:position           | <http://dbpedia.org/resource/Goalkeeper_(association_football)>                       |
| dbpprop:shortDescription   | "Dutch footballer"@en                                                                 |
| dbpprop:title              | "Awards"@en                                                                           |
| dbpprop:title              | "Netherlands squads"@en                                                               |
| dbpprop:years              | 2002                                                                                  |
| dbpprop:years              | 2011                                                                                  |
| dbpprop:youthclubs         | dbpedia:AFC_Ajax                                                                      |
| dbpprop:youthclubs         | "Schoten"@en                                                                          |
| dbpprop:youthclubs         | "Zandvoort '75"@en                                                                    |
| dbpprop:youthyears         | 1997                                                                                  |
| dbpprop:wordnet_type       | <http://www.w3.org/2006/03/wn/wn20/instances/synset-soccer_player-noun-1>             |
| dbpprop:hasPhotoCollection | <http://wifo5-03.informatik.uni-mannheim.de/flickrwrappr/photos/Maarten_Stekelenburg> |
----------------------------------------------------------------------------------------------------------------------

You mentioned storing results in an array, but I don't really understand the example that you've provided. It looks more like a query than code to put something into an array. Additionally, you haven't specified what programming language you're working with, so we can't really respond with array manipulation code.