Common-SenseMakers / sensemakers

Sensemakers infrastructure for developing AI-based tools for semantic annotations of social posts. Cross-poster app to publish your semantic posts on different networks.
https://sense-nets.xyz/
GNU General Public License v3.0
2 stars 2 forks source link

[NLP] Wrong triplets pass through by parser #136

Open ShaRefOh opened 4 months ago

ShaRefOh commented 4 months ago

Some triplets have the object http://sensentes/ThisText instead of sub:assertion.

See https://np.test.knowledgepixels.com/RAcRDZ_FVHwfAvSfL06jDt58kdIkkqvk4nlQa5FmYN5Ds

ShaRefOh commented 4 months ago

@ronentk, is http://sensentes/ThisText the object placeholder for all triplets?

ShaRefOh commented 4 months ago

Now the create.nanopub.ts , createNanopublication function first parses the rdf from the python to a n3 store, then it replaces all nodes in the store with uri https://sense-nets.xyz/mySemanticPost to http://purl.org/nanopub/temp/mynanopub#. using Pepo's replaceNode function:

const semanticsParserStore = await (async () => {
    if (!semantics) return new Store();

    return await parseRDF(semantics);
  })();
  // Define the replacement map that swaps our placeholder with np placeholder 
  const replaceMap: Record<string, string> = {
    'https://sense-nets.xyz/mySemanticPost': 'http://purl.org/nanopub/temp/mynanopub#'
  };

  const semanticsStore = replaceNodes(semanticsParserStore, replaceMap);
ronentk commented 4 months ago

Ok @pepoospina @ShaRefOh I created a PR to update the placeholder