Skip to content

Idea: ActivityStreams JSON-LD #85

@sebilasse

Description

@sebilasse

Hey Max,

a feature request:

currently I am using the simplified versions of getManyEntities reducing it for simplify like

.reduce((oneObject, fromMany) => {
    for (const wikibaseId in fromMany) {
      oneObject[wikibaseId] = fromMany[wikibaseId];
    }
    return o;
  }, {});

then I do map it to an ActivityStreams JSON-LD "type": "Profile" with e.g. "describes": "wdt:Q1055"
(
simple, with default AS context and "wdt" prefix for wikidata
and in the following example
alternativeNameMap: { "@id": "wdt:P4970", "@container": "@language" },
)
by just renaming
modified -> updated
labels -> nameMap
aliases -> alternativeNameMap
descriptions -> summaryMap
and prefixing other properties with "wdt:" we would have a nice ActivityStreams representation for further use in ActivityPub.
I do also have a mapping from all properties to tag, url, image, icon
I mean, ActivityStreams is well defined and it would just need a few changes and could become a valuable option.

const res: any = {
  id: wd.id,
  updated: wd.modified || new Date().toISOString(),
  nameMap: wd.claims && wd.claims.labels ? wd.claims.labels : {},
  alternativeNameMap: wd.claims && wd.claims.aliases ? wd.claims.aliases : {},
  summaryMap: wd.claims && wd.claims.descriptions  ? wd.claims.descriptions : {},
  tag: [],
  url: [],
  image: [],
  icon: [],
  // all wikidata properties as "wdt:P..."
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions