1

I installed an RDF module on my Drupal 8 site and it seems that I can pick the exact options from the exact same list for both Content types (Drupal concept) as well as for fields.

It seems quite wired to me as I was sure that the terms using for S.org properties and the terms using for S.org types are different from one another.

Either each term can act both as a property or type, or otherwise I can't explain it.

5
  • 1
    Your assumption is correct, Schema.org types are not supposed to be used as properties, and vice-versa (however, I guess technically/formally they could be used for anything in RDF -- but it wouldn’t make sense to do this). -- Does this mean you can select, e.g., name as type for a content type? Are you only using core modules, or also drupal.org/project/rdfui or something else?
    – unor
    Jul 30, 2016 at 2:35
  • It seems I had a mistake, the lists mistakenly seemed to me to be identical... I should delete the question and edit my report at D.O thanks for you help and suggestion to check both lists with the "Name" property.
    – user58733
    Jul 30, 2016 at 2:47
  • I also thought the Hierarchy is property-type when its actually type-property...
    – user58733
    Jul 31, 2016 at 5:09
  • BTW @unor , What do you think is the best practice when picking SO type for a Drupal content-type ? I assume picking one single SO type for all Drupal content-types is best but I might be wrong. What do you think ?
    – user58733
    Jul 31, 2016 at 5:10
  • 1
    The power of Drupal’s content type system is that you can have different "templates" for different content (a page about a person needs different fields/layout/URL path/etc. than a page about a book). Why would you throw away this advantage when mapping to Schema.org? A content type that represents a book should have the type Book, a content type that represents a blog post should have the type BlogPosting, etc.
    – unor
    Jul 31, 2016 at 11:30

1 Answer 1

1
+50

Your assumption is correct. Schema.org types (aka. classes) are not supposed to be used as properties, and vice-versa. (Technically they could be used for anything, but it wouldn’t make sense to do this.)

But the RDF UI module is doing it correctly:

  • When editing a content type, you can select (under "Schema.org Mappings") a type:

    Specify the type you want to associated to this content type e.g. Article, Blog, etc.

    The autocomplete list correctly lists/suggests types, i.e., terms that start with an uppercase letter (like Thing).

  • When mapping a field (under "Manage fields" → "RDF Mappings"), you can select a property.

    The autocomplete list correctly lists/suggests properties, i.e., terms that start with a lowercase letter (like name).

If you have a content type "Team member", you could map it to the Schema.org type Person, and the field "Title" could be mapped to the Schema.org property name.

Background

Note that it’s just a convention (followed by Schema.org and many other vocabularies) to start types with uppercase letters, and properties with lowercase letters. A vocabulary could as well use x8234 for a type and x8238 for a property.

If something is supposed to be a type or a property should ideally become clear in the vocabulary’s documentation, but the canonical definition can be found in the vocabulary’s RDF.

In case of Schema.org (canonical definition in RDFa), you can see that name is of type rdf:Property:

<div typeof="rdf:Property" resource="http://schema.org/name"> 
  <!-- … -->
</div>

and Person is of type rdfs:Class:

<div typeof="rdfs:Class" resource="http://schema.org/Person">
  <!-- … -->
</div>
3
  • Unor, small comment-level question, if it's okay: To give a S.org type for my homepage, I created a whole new content-type for it... What do you think is the best type for that? I gave it "ProfessionalService" as my website represents services I give. Is there something generic you choose for homepage content-types? I ask for general knowledge. Much thanks for everything.
    – user58733
    Aug 3, 2016 at 21:54
  • Gonna give you the bounty for this professional answer btw... :) The system allows me to do so in about 23 hours...
    – user58733
    Aug 3, 2016 at 21:54
  • 1
    @Benia: Thank you. Regarding your question about type(s) for the homepage: Sometime I use WebSite with the topic the website is about in about (e.g., WebSite about Thing), possibly with WebPage (which I typically use on every page) in addition -- where Thing is typically an Organization (if it’s a company’s website) or Person (if it’s a personal website) etc. -- Note that ProfessionalService is deprecated; in most cases, Service might be used instead.
    – unor
    Aug 6, 2016 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.