Create own properties to using Schema.org with RDFa Lite? - semantics

So Im putting semantics on my page using RDFa Lite and the vocabulary Schema.org, but I have ran into an problem. Im putting it on a Person that is a soocer player. I got informations like player number, player position and so on? How do I define these with Schema.org?
So my code looks like this
<div class="indhold" vocab="http://schema.org/" typeof="Person">
<h2>Spiller - <span property="name" >Morten Jensen</span></h2>
<img property="image" src="http://e2.365dm.com/12/06/660x350/YannMvila_2775667.jpg" alt="Morten Jensen billede" class="spiller" />
<p><b>Navn:</b> <span property="name">Morten Jensen</span></p>
<p><b>Fødselsdag:</b> <span property="birthDate">1989-12-12</span></p>
<p><b>Hold:</b> <span property="memberOf"><span typeof="Organisation" property="name">FC København</span></span></p>
<p><b>Spillernr.:</b> <span property="playerNumber">2</span></p>
<p><b>Position:</b> <span property="playerPosition">Målmand</span></p>
<p><b>Beskrivelse:</b><br/>
<span property="description">Denne spiller startede i en meget tidlig alder, men var fast besluttet på at blive en kæmpe stjerne! Om få år spåes han en kæmpe fremtidig indenfor dansk fodbold! </span>
</p>
</div>
I have tried google, but Im not quite sure you can just create properties like that?

To extend schema.org to support custom properties you usually have to find a more generic type or property that is a superset of your custom term. In the case of playerNumber and playerPosition, I can't think of any property from schema.org that relates to these two custom terms. You could potentially use 'description' even though it is very generic, so something like:
property="description/playerNumber"
property="description/playerPosition"
In any case, this should not prevent you from publishing your content in RDFa lite. If you are not sure what to do about playerNumber and playerPosition, you can also just leave them out and not add RDFa Lite for them. You don't have to annotate every single item of your page, you can always improve that later.
You could also ask your question on http://lists.w3.org/Archives/Public/public-vocabs/, it is the official mailing list for the scgem
BTW, the rest of your markup looks good. Just make sure to move the typeof="Organization" into the span that has property="memberOf", since you are defining a new entity organization entity, it should be in the same HTML element as the property that creates it. Also, in schema.org, Organization is spelt in US English with a "z".

Related

TYPO3 Flux create extendable link list

I want to create an extendable list of links with flux. That means I want a backend form to create and add as many links as needed. Using TYPO3 8.7, Flux, Fluidcontent, VHS. How do I do that?
Output Html shall look like this:
<h3>Links Headline </h3>
<ul class="mylist">
<li>Linktext one</li>
<li>Linktext two</li>
...
</ul>
Seems to be very simple, but I haven´t found a solution for it yet.
Thanks for advices
You can do this by creating a section in your flux configuration.
<flux:form.section name="settings.linklist" label="Definitions">
<flux:form.object name="listitem" label="Definition">
<flux:field.input name="label" label="Label"/>
<flux:field.input name="link" label="Link">
<flux:wizard.link/>
</flux:field.input>
</flux:form.object>
</flux:form.section>
Rendering the list in the frontend with:
<f:for each="{settings.linklist}" as="item">
For further information see the documentation: https://fluidtypo3.org/viewhelpers/flux/master/Form/SectionViewHelper.html

Defining a relationship between a country and a recipe with Schema

I am building a web page that lists typical dishes for each individual country. Each dish is put in its own article and all of that goes fine. But I wonder if there is a way to link the Recipes to the country. Does it make sense to also specify the country with http://schema.org/Country, and if so how can I link that to the dishes?
I thought about defining the main as a country, and then using http://schema.org/additionalProperty but that doesn't seem to make sense as it expects a PropertyValue, which the recipes aren't.
<main>
<h1>France</h1>
<p>
<span class="capital" title="Capital">Paris</span>
<span class="member-since" title="Member of the EU since 1958">1958</span>
</p>
<article id="recipe-1" itemscope itemtype="http://schema.org/Recipe">
<h1>Éclairs</h1>
<!-- A lot of recipe-related stuff -->
</article>
<article id="recipe-2" itemscope itemtype="http://schema.org/Recipe">
<h1>Macaron</h1>
<!-- A lot of recipe-related stuff -->
</article>
<article id="recipe-3" itemscope itemtype="http://schema.org/Recipe">
<h1>Tarte Tatin</h1>
<!-- A lot of recipe-related stuff -->
</article>
</main>
You can provide the cuisine of a Recipe with its recipeCuisine property:
The cuisine of the recipe (for example, French or Ethiopian).
It expects a Text value.
There is also the locationCreated property, which expects a Place value (which includes Country), but it might be a stretch to use it in this context. Also it wouldn’t be clear if it refers to the location where the recipe is originally coming from, or to the location where the written form was created.
Schema.org doesn’t seem to offer a property to connect a Country and Recipe directly. But you could still connect the items via WebPage.
So for example, if you say WebPage about Country and WebPage mainEntity ItemList, and have each Recipe as itemListElement, there is at least some connection (a page about a specific country has a list of recipes as main content = the recipes are probably related to that country).

Selenium access a form field with bad id

Looking for the best approach to enter / read a value from a form field that lacks human readable ids / references.
The basic outline looks like
<div id="form-2143">
<div id="numberfield-1234">
<label id="numberfield-1234-label">
<span class="x-form-label">Field Name 1</span>
</label>
<div id="numberfield-1234-body">
<div id="numberfield-1234-wrap">
<input id="numberfield-1234-input" class="form-field" componentid="numberfield-1234">
</div>
</div>
</div>
...
</div>
There are more class defs and attributes involved, but above is the "basics" I have to work with.
This form has a number of entries, and there are more forms like it, so I am looking for a way to search for the label name, and access the input field within the same container.
I lack control of the site and cannot edit the HTML structure of the site; meaning I cannot give sensible names to the ids, but want to avoid hard referencing the poor names. Any suggestions on how to get Robot Framework & selenium to reference these elements?
Highlighting Andersson's answer in the comments
Using the XPath
//label[span[text()="Field Name 1"]]/following-sibling::div//input
Works for the above example.
The key part that answers the question of how to reference nearby elements is
/following-sibling

Floor number with schema.org microdata?

Any idea how to markup a floor number with schema.org microdata for a local business' postal address?
<div itemscope itemtype="http://schema.org/LocalBusiness">
<span itemprop="legalName">Company Limited</span>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<div itemprop="streetAddress">Billy Street 100</div>
<div>10th Floor</div>
<div><span itemprop="addressLocality">Paris</span>,
<span itemprop="addressRegion">TX</span>
<span itemprop="postalCode">75462</span></div>
<div itemprop="addressCountry">United States</div>
</div>
</div>
Also, is the above markup semantic?
If there's no floor number, should I use RDFa?
Unfortunately, schema.org doesn't have a property for secondary address line, which is where the floor number would go. postOfficeBoxNumber is as close as it gets, but it looks like it's reserved specifically for PO Box numbers, not the whole line that contains PO Box.
Perhaps you could put floor number in streetAddress, on a new line using a <br> tag.
Although I know a lot about street addresses (I work at SmartyStreets), I'm not a microdata expert: but from what I can tell, yes, the markup looks okay to me.
And you could use RDFa instead if you'd like: Google supports it for its rich snippets. Or you could have some fun and extend schema.org for your needs.

How to get an article description or excerpt within Expression Engine

I saw in Expression Engine I can use {embed:title} and {site_name} variables, but now I need a variable to pull an excerpt or description of the article itself. Is there such a variable/tag?
ExpressionEngine tags are based solely on custom fields which you yourself have defined. So in the field group for your "articles" channel, you'll have some fields, maybe {article_summary}, {article_body}, {article_image}, etc. To display your summary, just use {article_summary} in your template.
I'm assuming that you're coming from something like WordPress maybe, where every piece of content has the_content() and the_excerpt() ... aside from a handful of global variables, and some fields which are universal to all entries (like {title}, {entry_date}, etc), ExpressionEngine isn't like that. You define what fields you use for each channel - you have complete control.
Here is the actual code you have to include in your EE template.
{exp:channel:entries channel="article" limit="5" dynamic="no"}
<div class="home_thumb">
<h1>{title}</h1>
<div class="home_thumb_img">
<img src="{article_image}">
{if article_content}
<p>{article_content}</p>
{/if}
</div>
</div>
{/exp:channel:entries}