Topic on Extension talk:WikibaseMediaInfo/RDF mapping

Jump to navigation Jump to search

Mapping from filenames to MediaObjects

Dipsacus fullonum (talkcontribs)

The example

<> a schema:Article ;

schema:about sdoc:M222222 ;

schema:isPartOf <> .

should give a way to get from a filename to a MediaObject. But in WCQS there are no triples with the predicate schema:about and no objects of type schema:Article.

Is the description here outdated or is the triples missing in WCQS?

What is the recommended way to get a MediaObject if you have the filename? You can go the opposite way with schema:contentUrl by taking the last part of the URI and decode, but you cannot construct the contentURI from the filename.

Lucas Werkmeister (WMDE) (talkcontribs)

Hm, strange. The only way I found to get the entity is this terrible hack (do not use) to get the page ID via MWAPI:

  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:endpoint "";
                    wikibase:api "Generator";
                    mwapi:generator "allpages";
                    mwapi:gapfrom "Mapa de Palomino.jpg";
                    mwapi:gapto "Mapa de Palomino.jpg";
                    mwapi:gapnamespace "6".
    ?pageId wikibase:apiOutput "@pageid".
  BIND(IRI(CONCAT(STR(sdc:M), ?pageId)) AS ?entity)

Try it!

I think I’ll leave the better answering of this to the WCQS team :)

Reply to "Mapping from filenames to MediaObjects"