Can I use gr:category in GoodRelations and rdf:type from productontology together?

StackOverflow https://stackoverflow.com/questions/23549235

  •  18-07-2023
  •  | 
  •  

문제

Can I use gr:category and rdf:type from product ontology together?

I see vso:Canoe from automobile ontology...

<div typeof="gr:SomeItems vso:Canoe" about="#product">
  <span property="g:name">ACME Foldable Canoe</span>
  <div property="gr:category" content="Outdoors/Boats/Canoes"></div>
</div>

However I'm using productontology,is this possible?

<div about="#myObject" typeof="http://www.productontology.org/id/Canoe">
  <div rel="rdf:type" resource="http://purl.org/goodrelations/v1#SomeItems"></div>
  <div property="gr:description" xml:lang="en">... a longer description ...</div>
  <div property="gr:name" xml:lang="en">.. a short name for the object ...</div>
  <div property="gr:category" content="Outdoors/Boats/Canoes"></div>
</div>
도움이 되었습니까?

해결책

Yes, that is well possible and increases a client's ability to understand your data.

So

<div about="#myObject" typeof="http://www.productontology.org/id/Canoe">
   <div rel="rdf:type" resource="http://purl.org/goodrelations/v1#SomeItems"></div>
   <div property="gr:description" xml:lang="en">... a longer description ...</div>
   <div property="gr:name" xml:lang="en">.. a short name for the object ...</div>
   <div property="gr:category" content="Outdoors/Boats/Canoes"></div>
</div>

is perfectly valid.

There is currently no official statement from major search engines on the ways they honor additional type information, but it is a safe assumption that

  1. it does not harm adn
  2. the more data of this form is out there, the more it will matter for search engines.

다른 팁

Yes, you can use types and properties from any namespace in RDFa (and RDF in general). In the case of your snippet, you could even get rid of the rdf:type line since @typeof accepts multiple types from any number of namespaces, and those types can be in the form of CURIEs or full URIs (same applies to @property). So your snippet would become:

<div about="#myObject" typeof="http://www.productontology.org/id/Canoe gr:SomeItems">
  <div property="gr:description" xml:lang="en">... a longer description ...</div>
  <div property="gr:name" xml:lang="en">.. a short name for the object ...</div>
  <div property="gr:category" content="Outdoors/Boats/Canoes"></div>
</div>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top