rdfa

Validate HTML/RDFa in Python

南楼画角 提交于 2019-12-23 18:20:38
问题 What's the best way to go about writing a python module that can validate HTML, especially with embedded RDFa? I'm familiar with validator.w3.org, and I'm interested in writing a custom validator that performs a similar function, but for a different standard that utilizes RDFa for element metadata. What are some good pieces of source code to look at, Python libraries to try out, things to keep in mind? 回答1: Emmett, I am not sure what you want to achieve. I did write an RDFa distiller in

RDFa OfferCatalog Syntax

只愿长相守 提交于 2019-12-20 04:18:41
问题 I have been trying to find the best way to link two items together using RDFa, specifically linking a Person to multiple SoftwareApplication entries. The way I currently do this on the author page is: <div class="container text-center" vocab="http://schema.org/" typeof="Person"> ... <span property="hasOfferCatalog" typeof="OfferCatalog"> <meta property="numberOfItems" content="10" /> <span property="itemListElement" typeof="CreativeWork"> <meta property="name" content="Project Name" /> <meta

When i declare property how to use it

南笙酒味 提交于 2019-12-13 02:56:35
问题 I use RDF/XML to represent some data. First of all i want to show that a person knows other person, i declare the property and i use the following code to specify that mark knows katrin and katrin knows john PART 1 <rdf:Property rdf:about="Know"> <rdfs:domain rdf:resource="#Person"/> <rdfs:range rdf:resource="#Person"/> </rdf:Property> PART2 <rdf:Description rdf:about="#Mark"> <dc:Knows rdf:resource="#Katrin"/> </rdf:Description> <rdf:Description rdf:about="#Katrin"> <dc:Knows rdf:resource="

SPARQL - Unknown namespace prefix error

痞子三分冷 提交于 2019-12-11 14:24:09
问题 I have a python file with imported rdflib and some SPARQL query implemented from rdflib import Graph import html5lib if __name__ == '__main__': g = Graph() g.parse('http://localhost:8085/weather-2.html', format='rdfa') res1 = g.parse('http://localhost:8085/weather-2.html', format='rdfa') print(res1.serialize(format='pretty-xml').decode("utf-8")) print() res2 = g.query("""SELECT ?obj WHERE { <http://localhost:8085/weather-2.html> weather:region ?obj . } """) for row in res2: print(row) res1

Format to use for exposing structured meta data (dublin core, rdf, atom)?

三世轮回 提交于 2019-12-11 05:49:03
问题 In an altruistic manner I would like to expose as much structured data about my website. I also wouldn't mind SEO boost but its secondary. Seems there are a couple of options: Full on RDF (kill me now XML) Atom with your own custom tags (liking that) RDFa in your webpage (might help SEO) Dublin Core Meta tags Dublin Core using RDFa Atom with RDFa I'm just trying to make it easy for people to get data off my site. The nice thing about standards is that there are so many of them to choose from.

Should og:image and og:url put in <meta> or <link>?

我与影子孤独终老i 提交于 2019-12-11 04:49:33
问题 For og:image and og:url , since they have URL, can I place them in a link tag instead of a meta tag, and is it preferable? Also what is the difference in using these two tags w.r.t. og:image and og:url ? 回答1: I don't know about other major consumers of the OGP so this might not be a problem for your case, but if you plan to implement it for Facebook, stick to meta tags. Doing a quick live test with the open graph debugger and fiddling with the og: tags, it appears that facebook only

How to Establish Relationships between rdfa lite nodes

孤人 提交于 2019-12-11 02:14:48
问题 trying to semantically mark up a report page about specific addresses. The page provides a report about the address's energy consumption and presents offers for a service related to the energy consumption. I would like to semantically represent the place's address, the energy report related to the address, and offers that are available to the address. Right now, I have markup that has an RDFa lite node for place and another node for the offers. What is the best way to structure this to

Dealing with non-semantic uses of “rel” in RDFa

…衆ロ難τιáo~ 提交于 2019-12-10 14:06:03
问题 I use RDFa to add linked data to my webpage. I also occasionally use the rel attribute in various tags for non-semantic purposes, such as triggering a javascript tooltip. I am wondering the there is something I can do to distinguish the uses. For instance, I have RDFa around my social network icons like so: <a rel="foaf:account" alt="twitter" href="https://twitter.com/cboettig"><i class="icon-twitter" rel="tooltip" title="follow me on twitter (reading, discussing)"></i></a> <a rel="foaf

Is this use of structured data incompatible with JSON-LD?

↘锁芯ラ 提交于 2019-12-08 18:52:41
StackOverflow has some good comparisons of Microdata, RDFa, and JSON-LD, especially in answers by "unor" in 2014 , 2015 , 2015 , and 2016 . Google specifically states "Google recommends using JSON-LD for structured data whenever possible." But when I look at the page source of a Google search, the very first content of the page is: <!doctype html> <html itemscope="" itemtype="http://schema.org/SearchResultsPage" lang="en"> The itemscope and itemtype attributes in the <html> tag are microdata. So why is Google using microdata when it tells us to use JSON-LD? Is there something about the use of

Applying RDFa to a list completed projects with location

删除回忆录丶 提交于 2019-12-08 09:48:00
问题 How would someone apply schema to a list of completed projects, for example a listing of projects that were completed by an architecture firm. Let's say you have a list of projects that were completed, consisting of information such as the date, location, description, etc. I don't know if it is necessarily considered a CreativeWork or a Place. I'm considering using the general ItemList/Item properties but not sure if there is much value in it. So having said that, would anyone expect this to