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