Tables include:
Demo.demo.Customers
Demo.demo.Orders:
Demo.demo.Customers:
Northwind RDF View Definition
prefix northwind: <http://www.openlinksw.com/schemas/northwind#>
...
create iri class northwind:Customer
<http://^{URIQADefaultHost}^/Northwind/Customer/%U#this>
(in customer_id varchar not null)
...
alter quad storage virtrdf:DefaultQuadStorage
...
from Demo.demo.Customers as customers
from Demo.demo.Orders as orders ...{
create virtrdf:NorthwindDemo
as graph iri ("http://^{URIQADefaultHost}^/Northwind") {
...
northwind:Customer(customers.CustomerID) a foaf:Organization
as virtrdf:Customer-CustomerID ;
northwind:companyName customers.CompanyName as ... ;
...
northwind:fax customers.Fax as virtrdf:Customer-fax .
northwind:Customer(orders.CustomerID)
northwind:has_order northwind:Order(orders.OrderID)
as virtrdf:Order-has_order .
...
}}
Demo.demo.Orders:
Northwind RDF View Definition
prefix northwind: <http://www.openlinksw.com/schemas/northwind#>
...
create iri class northwind:Order
<http://^{URIQADefaultHost}^/Northwind/Order/%d#this>
(in order_id integer not null) .
...
alter quad storage virtrdf:DefaultQuadStorage
...
from Demo.demo.Customers as customers
from Demo.demo.Orders as orders ... {
create virtrdf:NorthwindDemo
as graph iri ("http://^{URIQADefaultHost}^/Northwind") {
...
northwind:Order (orders.OrderID) a northwind:Order
as virtrdf:Order-Order ;
northwind:orderDate orders.OrderDate
as virtrdf:Order-order_date ;
northwind:requiredDate orders.RequiredDate
as virtrdf:Order-required_date ;
...
northwind:has_customer northwind:Customer (orders.CustomerID)
as virtrdf:Order-order_has_customer
northwind:has_employee northwind:Employee (orders.EmployeeID)
as virtrdf:Order-order_has_employee ;
...
} }
graph <http://www.openlinksw.com/oplweb>
subject p:product_iri (oplweb2.oplweb.product.product_id)
predicate p:description
object oplweb2.oplweb.product.product_description
Alternative SPARQL-Style Notation
graph <http://www.openlinksw.com/oplweb>
{
p:product_iri (oplweb2.oplweb.product.product_id) p:description
oplweb2.oplweb.product.product_description .
}
sparql
prefix prd: <http://www.openlinksw.com/schemas/oplweb/product#>
create iri class prd:product_iri
"http://www.openlinksw.com/oplweb/product#%s"
(
in product_id varchar not null
) .
create iri class prd:product_iri using
function oplweb2.oplweb.product_uri (in id varchar)
returns varchar,
function oplweb2.oplweb.product_uri_inverse (in id_iri varchar)
returns varchar .
prefix p: http://www.openlinksw.com/schemas/oplweb/product#
prefix pc: <http://www.openlinksw.com/schemas/oplweb/product_category#>
alter quad storage virtrdf:DefaultQuadStorage
from oplweb2.oplweb.product as product_tbl
from oplweb2.oplweb.product_category as product_category_tbl
{
create virtrdf:product_portfolio as graph <http://www.openlinksw.com/oplweb/>
{
p:product_iri(product_tbl.product_id) a p:Product
as virtrdf:product_product_id ;
p:details product_tbl.long_description
as virtrdf:product_long_description ;
p:product_category pc:product_category_iri(product_tbl.product_cat_id)
as virtrdf:product_product_cat_id .
pc:product_category_iri(product_category_tbl.product_cat_id)
a pc:ProductCategory
as virtrdf:product_category_product_cat_id ;
...
} .
} .
from oplweb2.oplweb.product as product_tbl
from DB.DBA.SYS_USERS as user where (^{user.}^.U_IS_ROLE = 0)
from DB.DBA.SYS_USERS as group where (^{group.}^.U_IS_ROLE = 1)
from DB.DBA.SYS_USERS as user where (^{user.}^.U_IS_ROLE = 0)
from DB.DBA.SYS_USERS as group where (^{group.}^.U_IS_ROLE = 1)
from DB.DBA.SYS_USERS as account
from user as active_user where (^{active_user.}^.U_ACCOUNT_DISABLED = 0)
from DB.DBA.SYS_ROLE_GRANTS as grant
where (^{grant.}^.GI_SUPER = ^{account.}^.U_ID)
where (^{grant.}^.GI_SUB = ^{group.}^.U_ID)
where (^{grant.}^.GI_SUPER = ^{user.}^.U_ID)