Skip to content

Commit

Permalink
Add @itemprop-reverse tests, for issue #5.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Nov 9, 2014
1 parent e49738d commit 969bedc
Show file tree
Hide file tree
Showing 11 changed files with 439 additions and 157 deletions.
12 changes: 12 additions & 0 deletions tests/0081.html
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Test 0081</title>
</head>
<body>
<div itemscope itemtype="http://schema.org/Person">
<span itemprop="name">William Shakespeare</span>
<link itemprop-reverse="creator" href="http://www.freebase.com/m/0yq9mqd">
</div>
</body>
</html>
8 changes: 8 additions & 0 deletions tests/0081.ttl
@@ -0,0 +1,8 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://www.freebase.com/m/0yq9mqd> schema:creator [
a schema:Person;
schema:name "William Shakespeare"
] .
19 changes: 19 additions & 0 deletions tests/0082.html
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Test 0082</title>
</head>
<body>
<div itemscope itemtype="http://schema.org/ShoppingCenter">
<span itemprop="name">The ACME Shopping Mall on Structured Data Avenue</span>
<span itemprop="description">The ACME Shopping Mall is your one-stop paradise for all data-related shopping needs, from schemas to instance data</span>
<p>Here is a list of shops inside:</p>
<div itemprop-reverse="containedIn" itemscope itemtype="http://schema.org/Restaurant">
<span itemprop="name">Dan Brickley's Data Restaurant</span>
</div>
<div itemprop-reverse="containedIn" itemscope itemtype="http://schema.org/Bakery">
<span itemprop="name">Ramanathan Guha's Meta Content Framework Bakery</span>
</div>
</div>
</body>
</html>
19 changes: 19 additions & 0 deletions tests/0082.ttl
@@ -0,0 +1,19 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

[
a schema:Bakery;
schema:containedIn _:mall;
schema:name "Ramanathan Guha's Meta Content Framework Bakery"
] .

[
a schema:Restaurant;
schema:containedIn _:mall;
schema:name "Dan Brickley's Data Restaurant"
] .

_:mall a schema:ShoppingCenter;
schema:description "The ACME Shopping Mall is your one-stop paradise for all data-related shopping needs, from schemas to instance data";
schema:name "The ACME Shopping Mall on Structured Data Avenue" .
12 changes: 12 additions & 0 deletions tests/0083.html
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Test 0083</title>
</head>
<body>
<div itemscope itemtype="http://schema.org/Person">
<span itemprop="name">William Shakespeare</span>
<meta itemprop-reverse="creator" content="foo">
</div>
</body>
</html>
5 changes: 5 additions & 0 deletions tests/0083.ttl
@@ -0,0 +1,5 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

[ a schema:Person; schema:name "William Shakespeare"] .
19 changes: 19 additions & 0 deletions tests/0084.html
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>Test 0084</title>
</head>
<body>
<div itemscope itemtype="http://schema.org/Organization">
<span itemprop="name">Cryptography Users</span>
<div itemprop-reverse="memberOf" itemprop="member" itemscope
itemtype="http://schema.org/OrganizationRole">
<div itemprop-reverse="memberOf" itemprop="member" itemscope
itemtype="http://schema.org/Person">
<span itemprop="name">Alice</span>
</div>
<span itemprop="startDate">1977</span>
</div>
</div>
</body>
</html>
16 changes: 16 additions & 0 deletions tests/0084.ttl
@@ -0,0 +1,16 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

_:alice a schema:Person;
schema:memberOf _:role;
schema:name "Alice" .

_:org a schema:Organization;
schema:member _:role;
schema:name "Cryptography Users" .

_:role a schema:OrganizationRole;
schema:member _:alice;
schema:memberOf _:org;
schema:startDate "1977" .
80 changes: 80 additions & 0 deletions tests/index.html
Expand Up @@ -1745,6 +1745,86 @@ <h2 itemprop="http://www.w3.org/2000/01/rdf-schema#comment">Positive processor t
</div>
<!-- End Test Description -->

<!-- Start Test Description -->
<div itemprop="entries"
itemscope="true"
itemtype="http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#ManifestEntry"
class="test-entry">
<span itemprop="name">Test 0081</span>:
<span itemprop="http://www.w3.org/2000/01/rdf-schema#comment"
>Simple @itemprop-reverse (experimental)</span>
(
<span itemprop="action"
itemscope="true"
itemtype="http://www.w3.org/2001/sw/DataAccess/tests/test-query#QueryTest">
<a itemprop="data" href="0081.html">input</a>
</span> |
<a itemprop="result" href="0081.ttl">result</a>
<meta itemprop="positiveTest" content="true"/>
)
</div>
<!-- End Test Description -->

<!-- Start Test Description -->
<div itemprop="entries"
itemscope="true"
itemtype="http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#ManifestEntry"
class="test-entry">
<span itemprop="name">Test 0082</span>:
<span itemprop="http://www.w3.org/2000/01/rdf-schema#comment"
>@itemprop-reverse with @itemscope value (experimental)</span>
(
<span itemprop="action"
itemscope="true"
itemtype="http://www.w3.org/2001/sw/DataAccess/tests/test-query#QueryTest">
<a itemprop="data" href="0082.html">input</a>
</span> |
<a itemprop="result" href="0082.ttl">result</a>
<meta itemprop="positiveTest" content="true"/>
)
</div>
<!-- End Test Description -->

<!-- Start Test Description -->
<div itemprop="entries"
itemscope="true"
itemtype="http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#ManifestEntry"
class="test-entry">
<span itemprop="name">Test 0083</span>:
<span itemprop="http://www.w3.org/2000/01/rdf-schema#comment"
>@itemprop-reverse with literal value (experimental)</span>
(
<span itemprop="action"
itemscope="true"
itemtype="http://www.w3.org/2001/sw/DataAccess/tests/test-query#QueryTest">
<a itemprop="data" href="0083.html">input</a>
</span> |
<a itemprop="result" href="0083.ttl">result</a>
<meta itemprop="positiveTest" content="true"/>
)
</div>
<!-- End Test Description -->

<!-- Start Test Description -->
<div itemprop="entries"
itemscope="true"
itemtype="http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#ManifestEntry"
class="test-entry">
<span itemprop="name">Test 0084</span>:
<span itemprop="http://www.w3.org/2000/01/rdf-schema#comment"
>@itemprop-reverse with @itemprop (experimental)</span>
(
<span itemprop="action"
itemscope="true"
itemtype="http://www.w3.org/2001/sw/DataAccess/tests/test-query#QueryTest">
<a itemprop="data" href="0084.html">input</a>
</span> |
<a itemprop="result" href="0084.ttl">result</a>
<meta itemprop="positiveTest" content="true"/>
)
</div>
<!-- End Test Description -->

</section>

<section id="negative-tests"
Expand Down

0 comments on commit 969bedc

Please sign in to comment.