JSON-LD是一种基于JSON的格式,用于序列化关联数据。该语法旨在轻松集成到已使用JSON的已部署系统中,并提供从JSON到JSON-LD的平滑升级路径。它主要用于在基于Web的编程环境中使用关联数据,构建可互操作的Web服务以及在基于JSON的存储引擎中存储关联数据。
使用 ActivityPub,导出带有发件箱的人员的有效且首选的方法是什么?
我想创建一个 JSON-LD 文件来表示人员及其状态列表的导出。目前没有可导入的目标系统,但我希望它与当前的一致
我有一个网页,其中包含三件事: 1.身体状况 2.医生 3.复习部分 4.三个视频 我想为页面编写架构 我已经写了下面的架构,但留下了信息...
如何表示 JSON-LD 中 SurgicalProcedure 架构类型的 howPerformed 属性中的多个步骤?
我正在编写 SurgicalProcedure 类型的模式,其中包含有关如何进行手术的步骤 JSON-LD 格式应该如何表示? 我想使用的属性是 howPerformed 这里...
是否可以直接对带有JSON-LD数据的网页运行SPARQL查询?
比如这个页面 https://www.bobdc.com/blog/json-ld/ ,查看页面源码时有: { &</desc> <question vote="0"> <p>比如这个页面<a href="https://www.bobdc.com/blog/json-ld/" rel="nofollow noreferrer">https://www.bobdc.com/blog/json-ld/</a>,查看页面源码时有:</p> <pre><code><html> <head> <script type="application/ld+json"> { "@context" : "http://schema.org", "@type" : "BlogPosting", "mainEntityOfPage": { "@type": "WebPage", "@id": "https:\/\/www.bobdc.com\/" }, "articleSection" : "blog", "name" : "Exploring JSON-LD", "headline" : "Exploring JSON-LD", "description" : "And of course, querying it with SPARQL.", "inLanguage" : "en", "author" : "Bob DuCharme", "creator" : "", "publisher": "", "accountablePerson" : "", "copyrightHolder" : "", "copyrightYear" : "2019", "datePublished": "2019-04-21 11:20:00 \u002b0000 UTC", "dateModified" : "2019-04-21 11:20:00 \u002b0000 UTC", "url" : "https:\/\/www.bobdc.com\/blog\/json-ld\/", "wordCount" : "1283", "keywords" : [ "RDF","JSON","SPARQL","Blog" ] } </script> ...... </code></pre> <p>我们可以直接对页面使用<strong>SPARQL</strong>查询吗?如果没有,有一些优雅的解决方法吗?</p> <p>我用谷歌搜索没有得到满意的结果。预先感谢您!</p> </question> <answer tick="false" vote="0"> <p>这对于普通的 SPARQL 来说是不可能的。需要预处理页面并将 JSON-LD 加载到某种内存三元组存储中,如评论中 @UninformedUser 所建议的那样。但是,不需要手动执行此操作,而是可以使用一些现成的工具:</p> <h1><a href="https://github.com/SPARQL-Anything/sparql.anything" rel="nofollow noreferrer">SPARQL 任何东西</a></h1> <p>它重载了 SPARQL SERVICE 运算符来解析来自 Web 或本地存储的多种文件。根据您的情况,创建以下查询文件 <pre><code>json-ld-in-html.rq</code></pre>:</p> <pre><code># vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv # vvv prefixes for your query vvv # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv # e.g. PREFIX schema: <http://schema.org/> # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # ^^^ prefixes for your query ^^^ # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SELECT * WHERE { SERVICE <x-sparql-anything:location=https://www.bobdc.com/blog/json-ld/,triplifier=io.github.sparqlanything.html.HTMLTriplifier,html.metadata=true> { # vvvvvvvvvvvvvvvvvv # vvv your query vvv # vvvvvvvvvvvvvvvvvv # e.g. [] schema:name ?title . [] schema:author ?author . # ^^^^^^^^^^^^^^^^^^ # ^^^ your query ^^^ # ^^^^^^^^^^^^^^^^^^ } } </code></pre> <p>然后执行查询:</p> <pre><code>java -jar sparql-anything-0.9.0.jar -q json-ld-in-html.rq -f TEXT </code></pre> <p>结果:</p> <pre><code>---------------------------------------- | title | author | ======================================== | "Exploring JSON-LD" | "Bob DuCharme" | ---------------------------------------- </code></pre> <p>通过一些更改,还可以提供 URL 作为参数或以其他格式返回输出。</p> </answer> </body></html>
为什么谷歌丰富的摘要显示:“项目不支持评论”? “@graph”关键字的实现是否正确?
以下架构正确吗? 我应该做一些改变吗? 如果我确实需要做出任何改变,我应该如何进行? { “@context”:...</desc> <question vote="0"> <p>以下架构正确吗? 我应该做一些改变吗? 如果我确实需要进行任何更改,我应该如何进行?</p> <pre><code><script type="application/ld+json"> { "@context": "https://schema.org", "@graph": [ { "@type": "MedicalCondition", "associatedAnatomy": { "@type": "AnatomicalStructure", "name": "Eye" }, "name": "Diabetic retinopathy", "signOrSymptom": [ { "@type": "MedicalSymptom", "name": "Floaters" }, { "@type": "MedicalSymptom", "name": "Dark Spot" }, { "@type": "MedicalSymptom", "name": "Blurred vision" }, { "@type": "MedicalSymptom", "name": "Reduced Night Vision" } ], "typicalTest": [ { "@type": "MedicalTest", "name": "OCT scan", "description": "An OCT scan is a non-invasive latest advancement in imaging technology. Similar to ultrasound, this diagnostic technique employs light rather than sound waves to achieve higher resolution (5 micron resolution) pictures of the structural layers of the ratina very prcisely.", "usesDevice": "Optical Coherence Tomography (OCT)", "image": "https://www.asianeyehospital.com/images/OCT.jpg" }, { "@type": "MedicalTest", "name": "FFA", "description": "It is a common procedure that is performed to give more information about the blood vessels of the retina. A fluorescein dye is injected in the blood vessel of the arm. Then by specialised magnifying camera quick photographs are taken of your retina.", "usesDevice": "Fundus Fluorescein Angiography (FFA)", "image": "https://www.asianeyehospital.com/images/fundus.jpg" } ] }, { "@type": "Person", "name": "DR. SHRUTIKA KANKARIYA", "affiliation": "Asian Eye Hospital", "alumniOf": [ { "@type": "EducationalOrganization", "name": "Seth GS medical college" }, { "@type": "EducationalOrganization", "name": "KEM hospital, Mumbai" }, { "@type": "EducationalOrganization", "name": "Sankara Netralaya ,Chennai" } ], "hasCredential": [ { "@type": "EducationalOccupationalCredential", "name": "MBBS" }, { "@type": "EducationalOccupationalCredential", "name": "DNB" }, { "@type": "EducationalOccupationalCredential", "name": "FICO" } ], "description": "Dr. Shrutika Junagade Kankariya, (MBBS, DNB, FICO, Fellow Retina and Diabetes Eye Disease) is an advanced medical retina, diabetic eye disease and cataract expert. She completed her medical college training from prestigious and one of the best medical college in India, Seth GS medical college and KEM hospital, Mumbai. She completed her ophthalmic education at one of the finest eye institute in Asia; Sankara Netralaya ,Chennai, under the aegis of diplomat of the national board (DNB). She has obtained FICO UK (Fellow international council of ophthalmology, united kingdom. Thereafter she underwent advanced fellowship in retinal disorders at sankara netralaya Chennai (Busiest center catering to referrals for retinal disorders from all over Asia)." }, { "@type": "Review", "author": "Mrs India and actor, model Poonam Shende", "reviewBody": "Its a dream come true for me to have perfect vision without glasses! Thank you Dr Kankariya for your magic :)", "itemReviewed": { "@type": "Thing", "name": "Asian Eye Hospital" }, "reviewRating": { "@type": "Rating", "ratingValue": 5, "worstRating": 1, "bestRating": 5 } }, { "@type": "Review", "author": "Bollywood Actress Sonalee Kulkarni", "reviewBody": "My entire family has got freedom from glasses at Asian Eye Hospital. Dr Kankariya has magical hands", "itemReviewed": { "@type": "Thing", "name": "Asian Eye Hospital" }, "reviewRating": { "@type": "Rating", "ratingValue": 5, "worstRating": 1, "bestRating": 5 } }, { "@type": "Review", "author": "Professor Dr Ioannis Pallikaris", "reviewBody": "Dr Vardhaman Kankariya is a globally renowned expert and I am proud to be his mentor. If I need eye surgery I will come to Dr Kankariya myself.", "itemReviewed": { "@type": "Thing", "name": "Asian Eye Hospital" }, "reviewRating": { "@type": "Rating", "ratingValue": 5, "worstRating": 1, "bestRating": 5 } }, { "@type": "Review", "author": "Hon. Ahmed Adeeb Former Vice President of Maldives", "reviewBody": "Dr Kankariya is truly an expert. I was referred to Asian Eye from Maldives for my eye treatment and I am very happy", "itemReviewed": { "@type": "Thing", "name": "Asian Eye Hospital" }, "reviewRating": { "@type": "Rating", "ratingValue": 5, "worstRating": 1, "bestRating": 5 } }, { "@type": "Review", "author": "Honourable Former President of India, Smt Pratibhatai Patil", "reviewBody": "I congratulate Dr Kankariya to have returned back to India and provide expertise to our Indian patients. Asian Eye Hospital is a boon for Pune", "itemReviewed": { "@type": "Thing", "name": "Asian Eye Hospital" }, "reviewRating": { "@type": "Rating", "ratingValue": 5, "worstRating": 1, "bestRating": 5 } }, { "@type": "VideoObject", "position": 1, "name": "Couple from Netherlands Undergo Successful Spectacle Removal Laser | Dr Kankariya | Pune", "url": "https://www.youtube.com/watch?v=g6Ktd62WV6g", "thumbnailUrl": [ "https://i.ytimg.com/vi/g6Ktd62WV6g/maxresdefault.jpg" ], "uploadDate": "2018-10-02", "duration": "PT0M42S", "contentUrl": "", "embedUrl": "https://www.youtube.com/embed/g6Ktd62WV6g", "interactionStatistic": { "@type": "InteractionCounter", "interactionType": { "@type": "http://schema.org/WatchAction" }, "userInteractionCount": 567 } }, { "@type": "VideoObject", "position": 2, "name": "Dr Shrutika Kankariya Zee TV Interview | Marathi | Cataract & Diabetes Eye Diseases | Asian Eye Pune", "url": "https://www.youtube.com/watch?v=kuRO8JRPGO8", "thumbnailUrl": [ "https://i.ytimg.com/vi/kuRO8JRPGO8/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG\u0026rs=AOn4CLC28IhXMx4-veeVcXO7C4au3X9pBA" ], "uploadDate": "2017-02-02", "duration": "PT22M421S", "contentUrl": "", "embedUrl": "https://www.youtube.com/embed/kuRO8JRPGO8", "interactionStatistic": { "@type": "InteractionCounter", "interactionType": { "@type": "http://schema.org/WatchAction" }, "userInteractionCount": 8907 } }, { "@type": "VideoObject", "position": 3, "name": "Padmavibhushan Dr K H Sancheti speaking about Dr Vardhaman Kankariya and Asian Eye Hospital, Pune", "url": "https://www.youtube.com/watch?v=9l3M5-S5g4w", "thumbnailUrl": [ "https://i.ytimg.com/vi/9l3M5-S5g4w/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG\u0026rs=AOn4CLDap5Qy_wNlTZV7rwRgpfx92ii4cQ%22," ], "uploadDate": "2018-11-14", "duration": "PT6M12S", "contentUrl": "", "embedUrl": "https://www.youtube.com/embed/9l3M5-S5g4w", "interactionStatistic": { "@type": "InteractionCounter", "interactionType": { "@type": "http://schema.org/WatchAction" }, "userInteractionCount": 1432 } } ] } </script> </code></pre> <p>对于上面的模式: 为什么谷歌丰富网页摘要工具显示: “商品不支持评论”</p> <p>以下部分以红色突出显示。</p> <p>另外,我对@graph关键字的实现是否正确?</p> <pre><code>@type": "Review", "author": "Professor Dr Ioannis Pallikaris", "reviewBody": "Dr Vardhaman Kankariya is a globally renowned expert and I am proud to be his mentor. If I need eye surgery I will come to Dr Kankariya myself.", "itemReviewed": { "@type": "Thing", "name": "Asian Eye Hospital" }, "reviewRating": { "@type": "Rating", "ratingValue": 5, "worstRating": 1, "bestRating": 5 } </code></pre> <p>如何解决这个问题?</p> </question> <answer tick="false" vote="0"> <p>丰富片段测试工具专注于可以产生丰富片段的结构化数据。您的评论是关于“事物”的。以下是 Google 可能显示评论的类型列表:</p> <p><a href="https://developers.google.com/search/docs/appearance/structured-data/review-snippet" rel="nofollow noreferrer">https://developers.google.com/search/docs/appearance/structed-data/review-snippet</a></p> </answer> </body></html>
MedicalProcedureType 类型是微创无创的。 代码应该怎么添加呢? { "@context": "http://schema.org", ...</desc> <question vote="1"> <p>MedicalProcedureType 类型是微创无创的。 代码应该如何添加?</p> <pre><code><script type="application/ld+json"> { "@context": "http://schema.org", "@type": "SurgicalProcedure", "name": "Intragastric Balloon", "url": "https://obesityasia.com/intragastric-balloon/", "image": "https://obesityasia.com/images/1.-Intra-Gastric-Ballon-1.jpg", "bodyLocation":"Stomach", "procedureType":{ "@type":"MedicalProcedureType", } } </script> </code></pre> </question> <answer tick="false" vote="0"> <p><a href="https://schema.org/procedureType" rel="nofollow noreferrer"><pre><code>procedureType</code></pre></a>属性的预期值是类<a href="https://schema.org/MedicalProcedureType" rel="nofollow noreferrer"><pre><code>MedicalProcedureType</code></pre></a>的实例。 Schema.org 目前定义了两个这样的实例 (<a href="https://schema.org/NoninvasiveProcedure" rel="nofollow noreferrer"><pre><code>NoninvasiveProcedure</code></pre></a>, <a href="https://schema.org/PercutaneousProcedure" rel="nofollow noreferrer"><pre><code>PercutaneousProcedure</code></pre></a>)。</p> <p>JSON-LD 示例:</p> <pre><code>"procedureType": { "@id": "http://schema.org/NoninvasiveProcedure" } </code></pre> <p>通过在这里使用 <pre><code>@id</code></pre>,可以传达该值是一个 IRI。这对于您使用 <pre><code>url</code></pre> 和 <pre><code>image</code></pre> 来说不是必需的,因为 <a href="https://schema.org/docs/jsonldcontext.json" rel="nofollow noreferrer">Schema.org 的 JSON-LD 上下文</a> 已经为这些属性定义了该内容,但没有为 <pre><code>procedureType</code></pre> 定义。</p> </answer> </body></html>
我正在尝试为我的页面进行正确的 JSON-LD 标记。我正在研究 NextJS(通过危险的SetInnerHTML 注入 JSON-LD),因此我将原始字符串化 JSON 注入渲染中。 假设我的页面想要...
Google Rich Results 测试 - 项目不支持评论测试搜索引擎优化
我在谷歌的丰富结果测试中尝试了很多东西,并遇到了这个问题。 测试搜索引擎优化 <p>我在 Google 的 Rich Results Test 上尝试了很多东西,然后遇到了这个问题。</p> <pre><code><html> <head> <title>Test SEO</title> <script type="application/ld+json"> { "@context":"https://schema.org", "@type":"Service", "name":"ABC", "aggregateRating":{ "@type":"AggregateRating", "ratingValue":5, "reviewCount":2 }, "review":[ { "@type":"Review", "name": "ABC", "author": { "@type": "Person", "name": "David A" }, "reviewBody":"Awesome", "reviewRating":{ "@type":"Rating", "ratingValue":5 } }, { "@type":"Review", "name": "ABC", "author": { "@type": "Person", "name": "David B" }, "reviewBody":"Great", "reviewRating":{ "@type":"Rating", "ratingValue":5 } } ] } </script> </head> <body> </body> </html> </code></pre> <p>当我运行测试时,它返回了 3 个错误,其中 2 个表示</p> <blockquote> <p>商品不支持评论</p> </blockquote> <p>其中 1 个人说</p> <blockquote> <p>字段“itemReviewed”的对象类型无效</p> </blockquote> <p>对于第一个错误,我不确定为什么会收到错误,因为我提供了 <pre><code>review</code></pre> 的所有必填字段(<a href="https://developers.google.com/search/docs/advanced/structured-data/review-snippet#review-properties" rel="nofollow noreferrer">https://developers.google.com/search/docs/advanced/structed-数据/评论片段#评论属性</a>)。</p> <p>至于第二个错误,我再次认为我根据 <a href="https://developers.google.com/search/docs/advanced/structured-data/review-snippet#aggregated-rating-type-definition" rel="nofollow noreferrer">https://developers.google.com/search/docs/advanced/structed-data/review-snippet#aggreated- rating-type-definition 提供了所有需要的字段</a>,但仍然返回该错误。</p> <p>我没有为这两个对象提供 <pre><code>itemReviewed</code></pre>,因为文档表明它是否是嵌套的,所以可以省略。</p> </question> <answer tick="true" vote="0"> <p>所以我找到的最佳答案是:<a href="https://support.google.com/webmasters/thread/38450143/doubts-about-service-schema?hl=en" rel="nofollow noreferrer">https://support.google.com/webmasters/thread/38450143/doubts-about-service-schema?hl=en</a></p> <p>看起来,尽管 <a href="https://schema.org/Service" rel="nofollow noreferrer">Schema.org</a> 支持 <pre><code>Service</code></pre>,但从外观来看,它并不是 Google 支持的模式类型的一部分(<a href="https://developers.google.com/search/blog/2019/09/making-review-rich-results-more-helpful" rel="nofollow noreferrer">https://developers.google.com/search/blog/2019 /09/使审查丰富的结果更有帮助</a>)。</p> <p>作为参考,<a href="https://developers.google.com/search/docs/advanced/structured-data/review-snippet#embedded-review-example" rel="nofollow noreferrer">这是他们文档中的示例</a>,如果您将 <pre><code>@type</code></pre> 从 <pre><code>Product</code></pre> 更改为 <pre><code>Service</code></pre>,您将看到弹出类似的错误。</p> <p>我猜这里的解决方案是从<pre><code>Service</code></pre>更新为<pre><code>Product</code></pre>,但考虑到GSC(Google Search Console)直到现在才发出警告,这有点奇怪......</p> </answer> </body></html>
下面的代码是由两个还是一个结构化数据组成?我可以使用模式类型“产品组”和“hasVariant”编写代码吗,因为“SS钢丝绳”,“PVC C...
下面代码中“@graph”关键字的应用是否正确? 我在这里试图做的是建立产品“钢丝绳”和钢丝绳类型之间的关系...
使用附加数据扩展 ApiPlatforms GetCollection 操作 JsonLd 响应
Symfony 6、Api 平台 3、Php 8 我有 Symfony-Doctrine 实体,已使用 Api-Platform 的 ApiResource 注释对其进行了注释,并且我正在使用 GetCollection 操作,该操作的作用是...
下面的代码是由两个还是一个结构化数据组成?我可以使用模式类型“产品组”和“hasVariant”编写代码吗,因为“SS钢丝绳”,“PVC C...
ASP.NET Core 在渲染 Json+Ld 脚本时不应在 TagBuilder 中对属性值进行编码
我写了一个HtmlHelper扩展来渲染Json+Ld脚本标签。 我向你求助的原因是,type属性值“application/ld+json”被编码,看起来像“applica...
如何将多个结构化数据组合到一个脚本标签中(ASP.NET、JS)
我有多个由网页上的不同组件生成的 JSON-LD 标记。这些组件在不同时间加载。我想将这些 JSON-LD 标记合并到一个标签中...
Stack Overflow 社区 我有一个网站,我使用 JSON-LD 脚本来包含结构化数据。在其中一个脚本中,我使用以下格式指定图像 URL: <p>Stack Overflow 社区</p> <p>我有一个网站,我使用 JSON-LD 脚本来包含结构化数据。在其中一个脚本中,我使用以下格式指定图像 URL:</p> <pre><code><script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "mainEntityOfPage": { "@type": "WebPage", "@id": "http://localhost/digitalclimbers/understand-laravel-with-features/" }, "headline": "What Is Laravel", "image": [ "http://localhost/digitalclimbers/wp-content/uploads/2023/03/Untitled-design-4-min-300x300.jpg", "http://localhost/digitalclimbers/wp-content/uploads/2023/03/Untitled-design-4-min-480x360.jpg", "http://localhost/digitalclimbers/wp-content/uploads/2023/03/Untitled-design-4-min-1200x840.jpg" ], "description": "Understand what is Laravel Framework, and its key features", "datePublished": "2023-03-29T21:29:59+05:30", "dateModified": "2024-01-26T09:43:41+05:30", "wordCount": 256, "about": ["Definition", "Laravel"], "articleSection": "Laravel", "inLanguage": "en-IN", "author": { "@type": "Person", "name": "Md Taufique Khan", "image": { "@type": "ImageObject", "url": "http://localhost/digitalclimbers/wp-content/uploads/2023/03/Untitled-design-5.jpg", "width": 150, "height": 150, "caption": "author alttag" }, "url": "https://example.com/author/john-doe", "sameAs": [ "https://lookmyweb.com", "https://google.com", "https://facebook.com" ] }, "publisher": { "@type": "Organization", "name": "Digital Climber", "logo": { "@type": "ImageObject", "url": "C:\\xampp\\htdocs\\digitalclimbers/wp-content/themes/tk/assets/Images/Logo/publisher-logo.webp", "width": 492, "height": 150, "caption": "Logo of Digital Climber - A Reliable Source for Learning Digital Marketing & Web Development" }, "url": "http://localhost/digitalclimbers", "sameAs": [ "link1", "link2", "link3" ] } } </script> </code></pre> <p>但根据 Google 的说法,该图片 URL 无效</p> <pre><code>"image": [ "http://localhost/digitalclimbers/wp-content/uploads/2023/03/Untitled-design-4-min-300x300.jpg", "http://localhost/digitalclimbers/wp-content/uploads/2023/03/Untitled-design-4-min-480x360.jpg", "http://localhost/digitalclimbers/wp-content/uploads/2023/03/Untitled-design-4-min-1200x840.jpg" ], </code></pre> <p>这是 <a href="https://search.google.com/test/rich-results/result?id=2fHGaw_g8pl6EdhuXMNwzg" rel="nofollow noreferrer">Google 报告</a></p> <p>帮我解决这个问题。</p> </question> <answer tick="false" vote="0"> <p>您需要将图像指定为ImageObject,还可以添加标题和创建日期等元信息:</p> <pre><code>"image": [ { "@type": "ImageObject", "url": "https://example.com/image1.jpg", "contentUrl": "https://example.com/image1.jpg", "caption": "Caption of image 1", "dateCreated": "2018-12-06" }, { "@type": "ImageObject", "url": "https://example.com/image2.jpg", "contentUrl": "https://example.com/image2.jpg", "caption": "Caption of image 2", "dateCreated": "2018-12-07" }, ] </code></pre> </answer> </body></html>
如何将 JSON-LD 面包屑模式添加到我的网站导航中以实现 SEO 目的
编辑:当我写问题时,我对这个问题的理解有所提高,但我仍然没有清除所有内容,这就是为什么我仍然问: 今天我被介绍给面包屑,我......
Google 识别的 JSON LD 格式的 Schema.org,但 Facebook Pixel Helper 无法检测到它
我使用添加了JSON LD格式的schema.org标签,当我使用Google结构化数据测试工具测试我的页面时,我可以看到我的所有标签。 但是,当我安装 Facebook Pixel Helper 时 </desc> <question vote="15"> <p>我使用<pre><code>JSON LD</code></pre>以<pre><code><script></code></pre>格式添加了schema.org标签,当我使用<a href="https://search.google.com/structured-data/testing-tool/u/0/" rel="noreferrer">Google结构化数据测试工具</a>测试我的页面时,我可以看到我的所有标签。</p> <p>但是,当我安装 <a href="https://chrome.google.com/webstore/detail/facebook-pixel-helper/fdgfkebogiimcoedlicjlajpkdmockpc?hl=en" rel="noreferrer">Facebook Pixel helper chrome 扩展</a> 来测试我的页面时,schema.org 标签显示为空白。不知道为什么 Facebook Pixel Helper 无法检测到它。</p> <p>非常感谢任何帮助。</p> </question> <answer tick="false" vote="9"> <p>我发现Facebook Pixel对结构化数据的解析更加严格。字段中的空白换行将导致它发出警告。当我在地址中进行换行时,我就发生了这种情况。谷歌正确解释了该地址,但 Facebook Pixel 在控制台中发出了警告。</p> <p>添加以下代码解决了我的情况:</p> <pre><code>$address = preg_replace( "/\r|\n/", " ", $address ); </code></pre> <p>当然,正如这里指出的那样<a href="https://stackoverflow.com/questions/2392766/multiline-strings-in-json">JSON不支持真正的换行符</a>。</p> </answer> <answer tick="false" vote="3"> <p>聚会迟到了,但对于来这里的人来说仍然如此。 FB Pixel 现在支持 JSON-LD:<a href="https://www.facebook.com/business/help/1175004275966513" rel="nofollow noreferrer">https://www.facebook.com/business/help/1175004275966513</a></p> </answer> <answer tick="false" vote="3"> <p>对我来说,多个空格都有错误(据我所知)。 <br/>因此,我使用这段代码:</p> <pre><code>$description = preg_replace("#\r|\n|(\s+)#iu", " ", $description); </code></pre> </answer> <answer tick="false" vote="0"> <p>JSON 扩展还为所有其他网页添加了 JSON-LD 格式的架构标记,这是 Google 喜欢的。 “Facebook Pixel”不读取架构元标签或 JSON-LD(Pinterest 读取架构元标签,但不读取 JSON-LD)。</p> <p>听起来您可能有点困惑 – Facebook 不读取架构标记 – Facebook 读取开放图元标签。您可以在这里找到该标准的详细信息:<a href="http://ogp.me/" rel="nofollow noreferrer">http://ogp.me/</a>。</p> <p>仅供参考 <a href="https://www.withintheflow.com/facebook-pixel-helper/" rel="nofollow noreferrer">https://www.withintheflow.com/facebook-pixel-helper/</a></p> </answer> <answer tick="false" vote="0"> <p>您可能碰巧在 init 调用中有 <pre><code>fbq('set', 'autoConfig', 'false')</code></pre>。 </p> <p>Facebook Pixel 会将元数据发送到您的 Pixel 设置,但在初始化代码中,如果您将 <pre><code>autoConfig</code></pre> 设置为 <pre><code>false</code></pre>,Facebook Pixel 将不会发送此附加信息。</p> </answer> <answer tick="false" vote="0"> <p>我还使用 Json-LD 脚本标签。就我而言,实际上是在标签开始发送此数据之前移动 Facebook 像素脚本!</p> </answer> </body></html>
如何解析vue3中“知识图谱搜索API”返回的JSON-LD
看来我太笨了或者只是盲目,因为我无法做到这一点。 我的另一个 Google API(Books API)非常有用。 使用 JSON 样式的返回数据很容易。 但是这个“知识图谱”
我对结构化数据以及 schema.org 和 json-ld 很陌生,过去几天一直在查看示例和文档。 我遇到了 @graph 数组,它让我很困惑。 雅高...
我对结构化数据以及 schema.org 和 json-ld 很陌生,我已经检查示例和文档几天了。 但我最近遇到了 @graph 数组,它让我感到困惑......