Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hasTopic field on Bookmark #10

Open
soltanireza65 opened this issue Nov 7, 2023 · 1 comment
Open

hasTopic field on Bookmark #10

soltanireza65 opened this issue Nov 7, 2023 · 1 comment
Assignees

Comments

@soltanireza65
Copy link
Contributor

https://pdsinterop.org/conventions/bookmark/

take a look at
bk:hasTopic :fiction;

@soltanireza65 soltanireza65 self-assigned this Nov 7, 2023
@soltanireza65
Copy link
Contributor Author

Just followed this test as an example solid-crud.test.ts

const bookmark = await BookmarkModel.at(
  "https://my-pod.solidcommunity.net/bookmarks/"
).create({
  label: "label",
  link: "https://podpro.dev/",
});

bookmark.topicRelationship().create({
  topic: "https://podpro.dev/test",
});

bookmark.save();

but the result was not as expected (create Topic and attach it into the bookmark)

result:

@prefix : <#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
@prefix bookm: <http://www.w3.org/2002/01/bookmark#>.
@prefix pod: <https://podpro.dev/>.
@prefix crdt: <https://vocab.noeldemartin.com/crdt/>.

:it a bookm:Bookmark; rdfs:label "label"; bookm:recalls pod: .

:it-metadata
    a crdt:Metadata;
    crdt:createdAt "2023-11-13T13:49:13.518Z"^^xsd:dateTime;
    crdt:resource :it;
    crdt:updatedAt "2023-11-13T13:49:13.518Z"^^xsd:dateTime.

there is no document for topic at all

I tried creating the topic first and the attach it's URL to bookmark in attributes:

const topic = await TopicModel
  .at("https://my-pod.solidcommunity.net/topics/")
  .create({ label: "soukai-solid" })

await topic.save()

const bookmark = await BookmarkModel.at('https://my-pod.solidcommunity.net/bookmarks/').create({
  label: "label",
  link: "https://podpro.dev/",
  topic: topic.getAttribute("url")
});

bookmark.save()

this time the result was 2 documents[bookmark and topic] with a link from bookmark to topic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant