# DiscussionForumPosting의 Schema.org 데이터 오류?

**URL:** https://meta.discourse.org/t/error-in-the-schema-org-data-for-discussionforumposting/259327
**Category:** Bug
**Created:** [3월 24, 2023, 6:58오후 UTC](https://meta.discourse.org/t/error-in-the-schema-org-data-for-discussionforumposting/259327 "2023-03-24T18:58:31Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [3월 24, 2023, 6:58오후 UTC](https://meta.discourse.org/t/error-in-the-schema-org-data-for-discussionforumposting/259327/1 "2023-03-24T18:58:31Z")

</div>

[DiscussionForumPosting](https://schema.org/DiscussionForumPosting)의 [Schema.org](http://Schema.org) 데이터에서 버그를 발견했습니다.

무작위로 선택한 Discourse 포럼 토픽을 [검증기](https://validator.schema.org/#url=https%3A%2F%2Fmeta.discourse.org%2Ft%2Fdoes-discourse-support-google-structured-data-i-e-schema-org%2F58249)에 통과시키면, 존재하지 않는 URL을 가진 `@id` 필드가 표시됩니다.

`/post_2`라는 후행 경로가 있는 예시입니다(이것은 `404` 오류입니다):

 ![discourse-schema](https://global.discourse-cdn.com/meta/original/4X/9/9/6/9965a0daa06275303e9481c4d64b3ec5b6a59bd0.png)

[W3.org](https://www.w3.org/TR/2014/REC-json-ld-20140116/#node-identifiers)에서 다음과 같이 언급하고 있으므로, 해당 `@id` 필드는 작동하는 URL이어야 한다고 생각합니다.

> 그래프 내의 노드를 외부에서 참조할 수 있으려면 노드가 식별자를 가져야 합니다. IRI는 Linked Data의 근본적인 개념이며, 노드가 진정한 의미로 연결되려면 식별자를 참조해 해당 노드의 표현을 가져올 수 있어야 합니다. 이를 통해 애플리케이션이 노드에 대한 추가 정보를 검색할 수 있게 됩니다.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [3월 28, 2023, 10:15오후 UTC](https://meta.discourse.org/t/error-in-the-schema-org-data-for-discussionforumposting/259327/2 "2023-03-28T22:15:11Z")

</div>

이것이 validator가 id를 표시하는 방식과 관련된 문제일 수 있다고 생각합니다. 제가 알기로는 id는 마크업에서 가져온 것이며, 우리가 직접 정의하는 것이 아닙니다. 예를 들어:

`<div id='post_1' itemscope itemtype='http://schema.org/DiscussionForumPosting' class='topic-body crawler-post'>`

여기서 ` id='post_1`이 `@id`에 해당합니다.

validator에서 해당 id 섹션을 클릭하면 일치하는 id를 가진 게시물이 올바르게 하이라이트됩니다… 따라서 validator가 이를 올바르게 식별할 수 있는 것으로 보입니다.

`@id` 값이 있는 다른 사이트에서도 이 동작을 확인할 수 있습니다. 예를 들어 이 [stackoverflow.com](http://stackoverflow.com) 질문의 스키마 데이터에서:

![Screenshot 2023-03-28 at 5.59.12 PM](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/4X/4/e/0/4e020235616f8e6bfd84a810560741fbb415fdb5.png)

여기에도 동일한 문제가 있으며, [https://stackoverflow.com/questions/7227202/answer-38775925](https://stackoverflow.com/questions/7227202/answer-38775925)는 실제로 유효한 URL이 아닙니다. `#`이 되어야 할 곳에 `/`가 사용되어 동일한 오류가 발생하고 있습니다. 올바른 형태는 [https://stackoverflow.com/questions/7227202#answer-38775925](https://stackoverflow.com/questions/7227202#answer-38775925)입니다.

실제로 이 데이터가 사용되는 방식에 문제가 되고 있다는 징후가 어딘가에 있나요?

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [3월 29, 2023, 3:28오전 UTC](https://meta.discourse.org/t/error-in-the-schema-org-data-for-discussionforumposting/259327/3 "2023-03-29T03:28:36Z")

</div>

흥미롭네요. HTML 소스를 확인해야 한다는 생각은 못 하고 JSON-LD라고 단정 지었었네요.

Google은 스키마 데이터를 사용하지만, 해당 특정 데이터를 사용하는지는 잘 모르겠습니다. [schema.org](http://schema.org) 문서가 매우 명확하게 작성되어 있지 않아서요.

Discourse가 각 주제에 여러 개의 `DiscussionForumPosting`을 넣는 것으로 보이는데, 문서의 예시를 보면 `DiscussionForumPosting`은 댓글이 아닌 주제 본문만을 지칭하도록 의도된 것 같습니다. 그런데 문서에는 `comment` 필드에 `Comment`(단수)가 나열되어 있으면서도 설명은 복수형으로 작성되어 있네요.

![image](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/optimized/4X/e/d/f/edf82fe00128b85227916fb12723eba7b000b287_2_690x44.png)

방금 Invison이 어떻게 처리하는지 살펴봤는데, JSON-LD를 사용하여 `comment` 필드에 `Comment` 객체를 넣고 있습니다. 브라우저에 전송하는 텍스트가 상당히 많은 것 같습니다.

정답이 무엇인지는 모르겠지만, 나중에 더 조사해 보겠습니다.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [3월 29, 2023, 7:25오전 UTC](https://meta.discourse.org/t/error-in-the-schema-org-data-for-discussionforumposting/259327/4 "2023-03-29T07:25:20Z")

</div>

이것이 관련이 있나요?

> [@Different schema type for Topics and Posts](https://meta.discourse.org/t/different-schema-type-for-topics-and-posts/71471/16?u=jammydodger):
>
> I know this is a super stale thread, but I just wanted to voice my support for this approach. I’ll follow up with more official channels/recommendations in the future but I wanted to just ping here because it was your own idea. My name is Ryan Levering and I handle structured data ingestion at Google ([this guy](https://www.youtube.com/watch?v=hUHjeDylhE8)). Discourse is sort of a snowflake in that it’s one of the only forum engines that uses DFPs at the root level for each comment in the thread. This makes it harder for us to figure out…

---

<div class="post-metadata">

### Author: ![rrlevering](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rrlevering/32/290917_2.png) [@rrlevering](https://meta.discourse.org/u/rrlevering)
#### Post date: [3월 29, 2023, 12:09오후 UTC](https://meta.discourse.org/t/error-in-the-schema-org-data-for-discussionforumposting/259327/5 "2023-03-29T12:09:01Z")

</div>

이 포럼을 우연히 지켜보고 있었는데, 참 잘됐다. 그 HTML을 파싱하는 Google 코드의 소유자니까.

링크된 스레드는 그 댓글로 이어진 논쟁에 대한 좋은 답변이다. 나머지 부분은 여기서 다루겠다.

HTML의 id 속성을 노드 ID로 해석하는 것은 기본적으로 비표준이다. Google의 마이크로데이터 파싱 초기에 아마도 모호한 이유로 그렇게 했을 것이다. 그렇게 하려면 명시적으로 itemid를 사용해야 한다. 언젠가 그 해킹 방식을 제거하길 바라지만, 손실 없이 그런 것을 제거하는 것은 어렵다.

두 번째로, IRI는 반드시 참조 가능(dereferencable)할 필요는 없다. 그것은 W3C의 권장 사항일 뿐이며, 많은 IRI가 그렇지 않으며 Google도 그것을 절대 요구하지 않는다.

이것은 구조화된 데이터의 노드가 의도치 않게 병합되는 문제를 일으킬 때만 문제가 된다. 예를 들어 HTML의 다른 곳에서 동일한 값의 itemid를 사용한 경우와 같은 경우다. 그렇지 않으면 무시해도 되는 이상한 현상에 불과하다.

아, 그리고 JSON-LD로 전환하지 말아달라. 솔직히 포럼과 같이 텍스트가 많은 마크업에는 그것이 더 선호된다. 텍스트 내용을 중복해서 작성해야 하는 것은 어리석은 일이다. 작성하기가 더 쉬워서 우리가 그것을 추진해 온 것이다.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [3월 29, 2023, 1:01오후 UTC](https://meta.discourse.org/t/error-in-the-schema-org-data-for-discussionforumposting/259327/6 "2023-03-29T13:01:48Z")

</div>

@rrlevering, lurking해 주셔서 감사합니다! 이 이슈를 안전하게 닫아도 될 것 같고, [https://meta.discourse.org/t/different-schema-type-for-topics-and-posts/71471/에서](https://meta.discourse.org/t/different-schema-type-for-topics-and-posts/71471/%EC%97%90%EC%84%9C) 토픽/게시물 스키마를 업데이트할 예정입니다.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [4월 1, 2023, 12:00오후 UTC](https://meta.discourse.org/t/error-in-the-schema-org-data-for-discussionforumposting/259327/7 "2023-04-01T12:00:09Z")

</div>

이 주제는 2일 후 자동으로 닫혔습니다. 더 이상 새 답변을 작성할 수 없습니다.
