Structured Data> Microdata & Json-LD> Entity Identifiers> Fragment Identifier

I was wondering if it is better / better to refer to entities using the fragment identifier format - mainly by inserting a hash before the name

[url] + # + [name] => http://example.com/page/#webPage

EDIT:

Following the kind response from the ubiquitous and wonderful @Unor, I added this change to try to limit the scope of my request and clarify the main problem that I am getting. I also deleted most of the original question (about 95%), which (in hindsight) I feel distracts from: 1. my main question; and 2. Benefits to future readers.

Here is my short problem:

Is the practice of manually entering a hash at the beginning of the microdata itemid and json-ld @id data values ​​valid?

Here is my question, expressed in more detail:

Is it possible to insert the HASH (#) symbol in the values ​​of the microdata itemid element and the json-ld @id values ​​to create valid resulting URIs with the correct and reliable use of the fragment identifier?

So if this is on the webpage:

<div itemscope itemtype="http://www.schema.org/Person" itemid="#joe"></div>

Or, if it is also on a web page:

{"@context":"http://schema.org",
"@type":"Person",
"@id":"#Joe"}

I understand that they will be read in order to make such a uri (assuming a relative construction by the consumer, like the Google tool for structured data):

http://www.example.com/page#joe

This is uri:

  • valid uri; and

  • is the fragment identifier (HASH) used correctly?

+4
source share
1 answer

URI (. URI Web: 1. .).

Hash URI, :

  • http://example.com/flower
  • http://example.com/flower#this
  • http://example.com/flower#this

URI , ( 303):

  • http://example.com/flower
  • http://example.com/flower/this
  • http://example.com/flower/this 303- URI (. )

, , Id Hash URI, .

( , " -", , : URI Hash " ", .)


( ):

, URI Hash itemid @id (), ( a #).

, URL- http://example.com/foobar URI- Hash (http://example.com/foobar#this):

<article itemscope itemtype="http://voc.example.net/Example" itemid="#this">
</article>

<article itemscope itemtype="http://voc.example.net/Example" itemid="http://example.com/foobar#this">
</article>

<script type="application/ld+json">
{
  "@context": "http://voc.example.net/",
  "@type": "Example",
  "@id": "#this" 
}
</script>

<script type="application/ld+json">
{
  "@context": "http://voc.example.net/",
  "@type": "Example",
  "@id": "http://example.com/foobar#this" 
}
</script>

( , URI : heres .)

:

  • , itemid="#joe" "@id":"#Joe" URI (j vs. j).
  • URL- Hash, , URL- . , (/page/#joe vs. /page#joe); ( /page?foo=bar Uash Hash /page?foo=bar#joe, /page#joe); www. ; URI (http vs. https); .
+6

Source: https://habr.com/ru/post/1615175/


All Articles