codeforpdx / codeforpdx/PASS

Clients are stored with invalid predicates

Open
#228 8 comments 0 reactions 1 assignee View on GitHub

@Lasiorhine is already working on this.

Since Jun 22, 2023.

bug good first issue
Dominant language
JavaScript
Stars
38
Forks
23
Avg merge
11m
Merged PRs (30d)
4

Description

Describe the bug

tl;dr: The data in the 'person' field on users doesn't comply with the schema.org spec.

Currently, the client list is storing clients in the userlist.ttl file on client pods with a format like the following:

<#http%3A%2F%2Flocalhost%3A3000%2Ftimbot%2Fprofile%2Fcard%23me>
    <http://schema.org/Person> "New Person";
    <http://schema.org/givenName> "New";
    <http://schema.org/familyName> "Person";
    <http://schema.org/identifier> <http://localhost:3000/timbot/profile/card#me>;
    <http://schema.org/URL> <http://localhost:3000/timbot/>.

This incorrectly handles the http://schema.org/Person predicate. We are using it as if it were a field, but it is actually a type. It is meant to describe what values the object holds, not hold a value itself. What we want to say here "this contact, identified by the URI, is a person, and they have the name "New Person"." However, what we're actually saying is "this contact, identified by the URI, persons the text "New Person."

Requested Fix

Rewrite the structure of the contacts list so that it is stored with valid RDF data.

A valid structure would be something like:

<#http%3A%2F%2Flocalhost%3A3000%2Ftimbot%2Fprofile%2Fcard%23me>
    a  <http://schema.org/Person>;
    <http://schema.org/givenName> "New";
    <http://schema.org/familyName> "Person";
    <http://schema.org/identifier> <http://localhost:3000/timbot/profile/card#me>;
    <http://schema.org/URL> <http://localhost:3000/timbot/>.

Note that instead of using http://schema.org/Person as a predicate, it uses a as the predicate, and http://schema.org/Person as the object. The a predicate is a reserved term in TTL. You can read more about it here

Another valid approach would be to remove the Person entry altogether.

Additional context
Most of the behavior about the contacts list is handled in src/hooks/useContactsList.js. That would be a good place to start looking for how to fix this

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.