Showing
1 changed file
with
152 additions
and
73 deletions
... | @@ -16,6 +16,7 @@ | ... | @@ -16,6 +16,7 @@ |
16 | @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | 16 | @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . |
17 | @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | 17 | @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . |
18 | @prefix rhspin: <http://www.reportinghub.no/spin/rh#> . | 18 | @prefix rhspin: <http://www.reportinghub.no/spin/rh#> . |
19 | +@prefix smf: <http://topbraid.org/sparqlmotionfunctions#> . | ||
19 | @prefix sp: <http://spinrdf.org/sp#> . | 20 | @prefix sp: <http://spinrdf.org/sp#> . |
20 | @prefix spif: <http://spinrdf.org/spif#> . | 21 | @prefix spif: <http://spinrdf.org/spif#> . |
21 | @prefix spin: <http://spinrdf.org/spin#> . | 22 | @prefix spin: <http://spinrdf.org/spin#> . |
... | @@ -104,14 +105,14 @@ arg:wellName | ... | @@ -104,14 +105,14 @@ arg:wellName |
104 | ] ; | 105 | ] ; |
105 | spin:constraint | 106 | spin:constraint |
106 | [ rdf:type spl:Argument ; | 107 | [ rdf:type spl:Argument ; |
107 | - rdfs:comment "The property that must be used in the result resource."^^xsd:string ; | 108 | + rdfs:comment "The value to match against."^^xsd:string ; |
108 | - spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ; | 109 | + spl:predicate sp:arg1 |
109 | - spl:valueType rdf:Property | ||
110 | ] ; | 110 | ] ; |
111 | spin:constraint | 111 | spin:constraint |
112 | [ rdf:type spl:Argument ; | 112 | [ rdf:type spl:Argument ; |
113 | - rdfs:comment "The value to match against."^^xsd:string ; | 113 | + rdfs:comment "The property that must be used in the result resource."^^xsd:string ; |
114 | - spl:predicate sp:arg1 | 114 | + spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ; |
115 | + spl:valueType rdf:Property | ||
115 | ] ; | 116 | ] ; |
116 | spin:returnType rdfs:Resource . | 117 | spin:returnType rdfs:Resource . |
117 | 118 | ||
... | @@ -266,15 +267,15 @@ rhspin:WDRTableTemplates | ... | @@ -266,15 +267,15 @@ rhspin:WDRTableTemplates |
266 | spin:abstract "true"^^xsd:boolean ; | 267 | spin:abstract "true"^^xsd:boolean ; |
267 | spin:constraint | 268 | spin:constraint |
268 | [ rdf:type spl:Argument ; | 269 | [ rdf:type spl:Argument ; |
269 | - rdfs:comment "The DDR that serves as root of the query."^^xsd:string ; | ||
270 | - spl:predicate arg:wellBore ; | ||
271 | - spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore> | ||
272 | - ] ; | ||
273 | - spin:constraint | ||
274 | - [ rdf:type spl:Argument ; | ||
275 | rdfs:comment "The start date of the reporting week."^^xsd:string ; | 270 | rdfs:comment "The start date of the reporting week."^^xsd:string ; |
276 | spl:predicate arg:startDate ; | 271 | spl:predicate arg:startDate ; |
277 | spl:valueType xsd:date | 272 | spl:valueType xsd:date |
273 | + ] ; | ||
274 | + spin:constraint | ||
275 | + [ rdf:type spl:Argument ; | ||
276 | + rdfs:comment "The DDR that serves as root of the query."^^xsd:string ; | ||
277 | + spl:predicate arg:wellBore ; | ||
278 | + spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore> | ||
278 | ] . | 279 | ] . |
279 | 280 | ||
280 | rhspin:baaById | 281 | rhspin:baaById |
... | @@ -573,6 +574,84 @@ rhspin:ddrActivityStartDate | ... | @@ -573,6 +574,84 @@ rhspin:ddrActivityStartDate |
573 | ] ; | 574 | ] ; |
574 | spin:returnType xsd:date . | 575 | spin:returnType xsd:date . |
575 | 576 | ||
577 | +rhspin:ddrOfWeek | ||
578 | + rdf:type spin:MagicProperty ; | ||
579 | + rdfs:comment """A magic property that finds all DailyDrillingReports (variable on right) that are within 7 days of the xsd:date (first value on the left) and for a given well bore (second value on the left). For example, | ||
580 | + | ||
581 | + (?startDate ?wellBore) rhspin:ddrOfWeek ?ddr"""^^xsd:string ; | ||
582 | + rdfs:label "DDR of week"^^xsd:string ; | ||
583 | + rdfs:subClassOf spin:MagicProperties ; | ||
584 | + spin:body | ||
585 | + [ rdf:type sp:Select ; | ||
586 | + sp:resultVariables ([ sp:varName "ddr"^^xsd:string | ||
587 | + ]) ; | ||
588 | + sp:where ([ rdf:type sp:TriplePath ; | ||
589 | + sp:object spin:_arg2 ; | ||
590 | + sp:path [ rdf:type sp:SeqPath ; | ||
591 | + sp:path1 | ||
592 | + [ rdf:type sp:SeqPath ; | ||
593 | + sp:path1 <http://www.reportinghub.no/ep/schema/report#reportOn> ; | ||
594 | + sp:path2 <http://www.reportinghub.no/ep/schema/activity#onWellBore> | ||
595 | + ] ; | ||
596 | + sp:path2 <http://www.reportinghub.no/ep/schema/core#temporalPartOf> | ||
597 | + ] ; | ||
598 | + sp:subject | ||
599 | + [ sp:varName "ddr"^^xsd:string | ||
600 | + ] | ||
601 | + ] [ rdf:type sp:TriplePath ; | ||
602 | + sp:object | ||
603 | + [ sp:varName "startDateTime"^^xsd:string | ||
604 | + ] ; | ||
605 | + sp:path [ rdf:type sp:SeqPath ; | ||
606 | + sp:path1 <http://www.reportinghub.no/ep/schema/report#reportOn> ; | ||
607 | + sp:path2 <http://www.reportinghub.no/ep/schema/activity#startedAt> | ||
608 | + ] ; | ||
609 | + sp:subject | ||
610 | + [ sp:varName "ddr"^^xsd:string | ||
611 | + ] | ||
612 | + ] [ rdf:type sp:Bind ; | ||
613 | + sp:expression | ||
614 | + [ rdf:type xsd:date ; | ||
615 | + sp:arg1 [ sp:varName "startDateTime"^^xsd:string | ||
616 | + ] | ||
617 | + ] ; | ||
618 | + sp:variable | ||
619 | + [ sp:varName "startDate"^^xsd:string | ||
620 | + ] | ||
621 | + ] [ rdf:type sp:Bind ; | ||
622 | + sp:expression | ||
623 | + [ rdf:type smf:duration ; | ||
624 | + sp:arg1 "d" ; | ||
625 | + sp:arg2 spin:_arg1 ; | ||
626 | + sp:arg3 [ sp:varName "startDate"^^xsd:string | ||
627 | + ] | ||
628 | + ] ; | ||
629 | + sp:variable | ||
630 | + [ sp:varName "days"^^xsd:string | ||
631 | + ] | ||
632 | + ] [ rdf:type sp:Filter ; | ||
633 | + sp:expression | ||
634 | + [ rdf:type sp:lt ; | ||
635 | + sp:arg1 [ sp:varName "days"^^xsd:string | ||
636 | + ] ; | ||
637 | + sp:arg2 7 | ||
638 | + ] | ||
639 | + ]) | ||
640 | + ] ; | ||
641 | + spin:constraint | ||
642 | + [ rdf:type spl:Argument ; | ||
643 | + rdfs:comment "The first day of the week."^^xsd:string ; | ||
644 | + spl:predicate sp:arg1 ; | ||
645 | + spl:valueType xsd:date | ||
646 | + ] ; | ||
647 | + spin:constraint | ||
648 | + [ rdf:type spl:Argument ; | ||
649 | + rdfs:comment "The well bore that the DDR must be about."^^xsd:string ; | ||
650 | + spl:predicate sp:arg2 ; | ||
651 | + spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore> | ||
652 | + ] ; | ||
653 | + spin:returnType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport> . | ||
654 | + | ||
576 | rhspin:ddrWellBoreId | 655 | rhspin:ddrWellBoreId |
577 | rdf:type spin:Function ; | 656 | rdf:type spin:Function ; |
578 | rdfs:comment "Gets the id of the well bore covered by a given DDR."^^xsd:string ; | 657 | rdfs:comment "Gets the id of the well bore covered by a given DDR."^^xsd:string ; |
... | @@ -657,15 +736,15 @@ rhspin:dtypeValue | ... | @@ -657,15 +736,15 @@ rhspin:dtypeValue |
657 | ] ; | 736 | ] ; |
658 | spin:constraint | 737 | spin:constraint |
659 | [ rdf:type spl:Argument ; | 738 | [ rdf:type spl:Argument ; |
660 | - rdfs:comment "The subject of the value."^^xsd:string ; | ||
661 | - spl:predicate sp:arg1 ; | ||
662 | - spl:valueType rdfs:Resource | ||
663 | - ] ; | ||
664 | - spin:constraint | ||
665 | - [ rdf:type spl:Argument ; | ||
666 | rdfs:comment "The predicate that points to the reified value."^^xsd:string ; | 739 | rdfs:comment "The predicate that points to the reified value."^^xsd:string ; |
667 | spl:predicate sp:arg2 ; | 740 | spl:predicate sp:arg2 ; |
668 | spl:valueType rdf:Property | 741 | spl:valueType rdf:Property |
742 | + ] ; | ||
743 | + spin:constraint | ||
744 | + [ rdf:type spl:Argument ; | ||
745 | + rdfs:comment "The subject of the value."^^xsd:string ; | ||
746 | + spl:predicate sp:arg1 ; | ||
747 | + spl:valueType rdfs:Resource | ||
669 | ] . | 748 | ] . |
670 | 749 | ||
671 | rhspin:facilityById | 750 | rhspin:facilityById |
... | @@ -1245,9 +1324,8 @@ rhspin:npdTripleExists | ... | @@ -1245,9 +1324,8 @@ rhspin:npdTripleExists |
1245 | ] ; | 1324 | ] ; |
1246 | spin:constraint | 1325 | spin:constraint |
1247 | [ rdf:type spl:Argument ; | 1326 | [ rdf:type spl:Argument ; |
1248 | - rdfs:comment "The subject to find"^^xsd:string ; | 1327 | + rdfs:comment "The object to match."^^xsd:string ; |
1249 | - spl:predicate sp:arg1 ; | 1328 | + spl:predicate sp:arg3 |
1250 | - spl:valueType rdfs:Resource | ||
1251 | ] ; | 1329 | ] ; |
1252 | spin:constraint | 1330 | spin:constraint |
1253 | [ rdf:type spl:Argument ; | 1331 | [ rdf:type spl:Argument ; |
... | @@ -1257,8 +1335,9 @@ rhspin:npdTripleExists | ... | @@ -1257,8 +1335,9 @@ rhspin:npdTripleExists |
1257 | ] ; | 1335 | ] ; |
1258 | spin:constraint | 1336 | spin:constraint |
1259 | [ rdf:type spl:Argument ; | 1337 | [ rdf:type spl:Argument ; |
1260 | - rdfs:comment "The object to match."^^xsd:string ; | 1338 | + rdfs:comment "The subject to find"^^xsd:string ; |
1261 | - spl:predicate sp:arg3 | 1339 | + spl:predicate sp:arg1 ; |
1340 | + spl:valueType rdfs:Resource | ||
1262 | ] ; | 1341 | ] ; |
1263 | spin:returnType xsd:boolean . | 1342 | spin:returnType xsd:boolean . |
1264 | 1343 | ||
... | @@ -1426,86 +1505,86 @@ rhspin:wellByName | ... | @@ -1426,86 +1505,86 @@ rhspin:wellByName |
1426 | ] ; | 1505 | ] ; |
1427 | spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> . | 1506 | spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> . |
1428 | 1507 | ||
1429 | -_:b1 sp:varName "subject"^^xsd:string . | 1508 | +_:b31 |
1430 | - | 1509 | + sp:varName "name"^^xsd:string . |
1431 | -_:b2 sp:varName "wellBoreName"^^xsd:string . | ||
1432 | 1510 | ||
1433 | -_:b3 sp:varName "wellBoreId"^^xsd:string . | 1511 | +_:b30 |
1512 | + sp:varName "id"^^xsd:string . | ||
1434 | 1513 | ||
1435 | -_:b4 sp:varName "wellBore"^^xsd:string . | 1514 | +_:b29 |
1515 | + sp:varName "t4"^^xsd:string . | ||
1436 | 1516 | ||
1437 | -_:b5 sp:varName "wellName"^^xsd:string . | 1517 | +_:b28 |
1518 | + sp:varName "t3"^^xsd:string . | ||
1438 | 1519 | ||
1439 | -_:b6 sp:varName "well"^^xsd:string . | 1520 | +_:b27 |
1521 | + sp:varName "t2"^^xsd:string . | ||
1440 | 1522 | ||
1441 | -_:b7 sp:varName "company"^^xsd:string . | 1523 | +_:b26 |
1524 | + sp:varName "t1"^^xsd:string . | ||
1442 | 1525 | ||
1443 | -_:b8 sp:varName "wellBore"^^xsd:string . | 1526 | +_:b25 |
1527 | + sp:varName "t0b"^^xsd:string . | ||
1444 | 1528 | ||
1445 | -_:b9 sp:varName "licence"^^xsd:string . | 1529 | +_:b24 |
1530 | + sp:varName "t0a"^^xsd:string . | ||
1446 | 1531 | ||
1447 | -_:b10 | 1532 | +_:b23 |
1448 | - sp:varName "share"^^xsd:string . | 1533 | + sp:varName "s2"^^xsd:string . |
1449 | 1534 | ||
1450 | -_:b11 | 1535 | +_:b22 |
1451 | - sp:varName "wellBore"^^xsd:string . | 1536 | + sp:varName "s1"^^xsd:string . |
1452 | 1537 | ||
1453 | -_:b12 | 1538 | +_:b21 |
1454 | - sp:varName "share"^^xsd:string . | 1539 | + sp:varName "normalizedStr"^^xsd:string . |
1455 | 1540 | ||
1456 | -_:b13 | 1541 | +_:b20 |
1457 | sp:varName "licence"^^xsd:string . | 1542 | sp:varName "licence"^^xsd:string . |
1458 | 1543 | ||
1459 | -_:b14 | 1544 | +_:b19 |
1460 | - sp:varName "company"^^xsd:string . | 1545 | + sp:varName "reif"^^xsd:string . |
1461 | - | ||
1462 | -_:b15 | ||
1463 | - sp:varName "companyName"^^xsd:string . | ||
1464 | 1546 | ||
1465 | -_:b16 | 1547 | +_:b18 |
1466 | - sp:varName "company"^^xsd:string . | 1548 | + sp:varName "value"^^xsd:string . |
1467 | 1549 | ||
1468 | _:b17 | 1550 | _:b17 |
1469 | sp:varName "wellBore"^^xsd:string . | 1551 | sp:varName "wellBore"^^xsd:string . |
1470 | 1552 | ||
1471 | -_:b18 | 1553 | +_:b16 |
1472 | - sp:varName "value"^^xsd:string . | 1554 | + sp:varName "company"^^xsd:string . |
1473 | 1555 | ||
1474 | -_:b19 | 1556 | +_:b15 |
1475 | - sp:varName "reif"^^xsd:string . | 1557 | + sp:varName "companyName"^^xsd:string . |
1476 | 1558 | ||
1477 | -_:b20 | 1559 | +_:b14 |
1560 | + sp:varName "company"^^xsd:string . | ||
1561 | + | ||
1562 | +_:b13 | ||
1478 | sp:varName "licence"^^xsd:string . | 1563 | sp:varName "licence"^^xsd:string . |
1479 | 1564 | ||
1480 | -_:b21 | 1565 | +_:b12 |
1481 | - sp:varName "normalizedStr"^^xsd:string . | 1566 | + sp:varName "share"^^xsd:string . |
1482 | 1567 | ||
1483 | -_:b22 | 1568 | +_:b11 |
1484 | - sp:varName "s1"^^xsd:string . | 1569 | + sp:varName "wellBore"^^xsd:string . |
1485 | 1570 | ||
1486 | -_:b23 | 1571 | +_:b10 |
1487 | - sp:varName "s2"^^xsd:string . | 1572 | + sp:varName "share"^^xsd:string . |
1488 | 1573 | ||
1489 | -_:b24 | 1574 | +_:b9 sp:varName "licence"^^xsd:string . |
1490 | - sp:varName "t0a"^^xsd:string . | ||
1491 | 1575 | ||
1492 | -_:b25 | 1576 | +_:b8 sp:varName "wellBore"^^xsd:string . |
1493 | - sp:varName "t0b"^^xsd:string . | ||
1494 | 1577 | ||
1495 | -_:b26 | 1578 | +_:b7 sp:varName "company"^^xsd:string . |
1496 | - sp:varName "t1"^^xsd:string . | ||
1497 | 1579 | ||
1498 | -_:b27 | 1580 | +_:b6 sp:varName "well"^^xsd:string . |
1499 | - sp:varName "t2"^^xsd:string . | ||
1500 | 1581 | ||
1501 | -_:b28 | 1582 | +_:b5 sp:varName "wellName"^^xsd:string . |
1502 | - sp:varName "t3"^^xsd:string . | ||
1503 | 1583 | ||
1504 | -_:b29 | 1584 | +_:b4 sp:varName "wellBore"^^xsd:string . |
1505 | - sp:varName "t4"^^xsd:string . | ||
1506 | 1585 | ||
1507 | -_:b30 | 1586 | +_:b3 sp:varName "wellBoreId"^^xsd:string . |
1508 | - sp:varName "id"^^xsd:string . | ||
1509 | 1587 | ||
1510 | -_:b31 | 1588 | +_:b2 sp:varName "wellBoreName"^^xsd:string . |
1511 | - sp:varName "name"^^xsd:string . | 1589 | + |
1590 | +_:b1 sp:varName "subject"^^xsd:string . | ... | ... |
-
Please register or login to post a comment