Added helper magic property to get all graphs that a given company has
access to
Showing
1 changed file
with
122 additions
and
52 deletions
... | @@ -367,6 +367,76 @@ rhspin:companyName | ... | @@ -367,6 +367,76 @@ rhspin:companyName |
367 | rdfs:subClassOf spin:Functions ; | 367 | rdfs:subClassOf spin:Functions ; |
368 | spin:returnType xsd:string . | 368 | spin:returnType xsd:string . |
369 | 369 | ||
370 | +rhspin:companyNameHasLicenceForGraph | ||
371 | + rdf:type spin:MagicProperty ; | ||
372 | + rdfs:comment "Finds all graphs (storing DDRs etc per licence) for a company with a given name (left side)."^^xsd:string ; | ||
373 | + rdfs:label "company name has licence for graph"^^xsd:string ; | ||
374 | + rdfs:subClassOf spin:MagicProperties ; | ||
375 | + spin:body | ||
376 | + [ rdf:type sp:Select ; | ||
377 | + sp:distinct "true"^^xsd:boolean ; | ||
378 | + sp:resultVariables ([ sp:varName "uri"^^xsd:string | ||
379 | + ]) ; | ||
380 | + sp:where ([ rdf:type sp:NamedGraph ; | ||
381 | + sp:elements ([ sp:object spin:_arg1 ; | ||
382 | + sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ; | ||
383 | + sp:subject | ||
384 | + [ sp:varName "company"^^xsd:string | ||
385 | + ] | ||
386 | + ] [ sp:object <http://www.reportinghub.no/np/schema/npd#OperatingCompany> ; | ||
387 | + sp:predicate rdf:type ; | ||
388 | + sp:subject | ||
389 | + [ sp:varName "company"^^xsd:string | ||
390 | + ] | ||
391 | + ] [ sp:object | ||
392 | + [ sp:varName "company"^^xsd:string | ||
393 | + ] ; | ||
394 | + sp:predicate <http://www.reportinghub.no/np/schema/npd#shareHolder> ; | ||
395 | + sp:subject | ||
396 | + [ sp:varName "share"^^xsd:string | ||
397 | + ] | ||
398 | + ] [ sp:object | ||
399 | + [ sp:varName "licence"^^xsd:string | ||
400 | + ] ; | ||
401 | + sp:predicate <http://www.reportinghub.no/np/schema/npd#licenceShared> ; | ||
402 | + sp:subject | ||
403 | + [ sp:varName "share"^^xsd:string | ||
404 | + ] | ||
405 | + ] [ sp:object <http://www.reportinghub.no/np/schema/npd#LS_Active> ; | ||
406 | + sp:predicate <http://www.reportinghub.no/np/schema/npd#licenceStatus> ; | ||
407 | + sp:subject | ||
408 | + [ sp:varName "licence"^^xsd:string | ||
409 | + ] | ||
410 | + ] [ sp:object | ||
411 | + [ sp:varName "id"^^xsd:string | ||
412 | + ] ; | ||
413 | + sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ; | ||
414 | + sp:subject | ||
415 | + [ sp:varName "licence"^^xsd:string | ||
416 | + ] | ||
417 | + ] [ rdf:type sp:Bind ; | ||
418 | + sp:expression | ||
419 | + [ rdf:type sp:iri ; | ||
420 | + sp:arg1 [ rdf:type fn:concat ; | ||
421 | + sp:arg1 "https://www.reportinghub.no/ep/graph/licence-" ; | ||
422 | + sp:arg2 [ sp:varName "id"^^xsd:string | ||
423 | + ] | ||
424 | + ] | ||
425 | + ] ; | ||
426 | + sp:variable | ||
427 | + [ sp:varName "uri"^^xsd:string | ||
428 | + ] | ||
429 | + ]) ; | ||
430 | + sp:graphNameNode npdata:npd | ||
431 | + ]) | ||
432 | + ] ; | ||
433 | + spin:constraint | ||
434 | + [ rdf:type spl:Argument ; | ||
435 | + rdfs:comment "The name of the company to get the graphs of."^^xsd:string ; | ||
436 | + spl:predicate sp:arg1 ; | ||
437 | + spl:valueType xsd:string | ||
438 | + ] . | ||
439 | + | ||
370 | rhspin:companyWithName | 440 | rhspin:companyWithName |
371 | rdf:type spin:Function ; | 441 | rdf:type spin:Function ; |
372 | rdfs:comment "Gets a Company with a given name from the NPD graph."^^xsd:string ; | 442 | rdfs:comment "Gets a Company with a given name from the NPD graph."^^xsd:string ; |
... | @@ -1319,89 +1389,89 @@ rhspin:wellByName | ... | @@ -1319,89 +1389,89 @@ rhspin:wellByName |
1319 | ] ; | 1389 | ] ; |
1320 | spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> . | 1390 | spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> . |
1321 | 1391 | ||
1322 | -_:b32 | 1392 | +_:b1 sp:varName "subject"^^xsd:string . |
1323 | - sp:varName "wellBore"^^xsd:string . | ||
1324 | 1393 | ||
1325 | -_:b31 | 1394 | +_:b2 sp:varName "wellBoreName"^^xsd:string . |
1326 | - sp:varName "name"^^xsd:string . | ||
1327 | 1395 | ||
1328 | -_:b30 | 1396 | +_:b3 sp:varName "wellBoreId"^^xsd:string . |
1329 | - sp:varName "id"^^xsd:string . | ||
1330 | 1397 | ||
1331 | -_:b29 | 1398 | +_:b4 sp:varName "wellBore"^^xsd:string . |
1332 | - sp:varName "t4"^^xsd:string . | ||
1333 | 1399 | ||
1334 | -_:b28 | 1400 | +_:b5 sp:varName "wellName"^^xsd:string . |
1335 | - sp:varName "t3"^^xsd:string . | ||
1336 | 1401 | ||
1337 | -_:b27 | 1402 | +_:b6 sp:varName "well"^^xsd:string . |
1338 | - sp:varName "t2"^^xsd:string . | ||
1339 | 1403 | ||
1340 | -_:b26 | 1404 | +_:b7 sp:varName "company"^^xsd:string . |
1341 | - sp:varName "t1"^^xsd:string . | ||
1342 | 1405 | ||
1343 | -_:b25 | 1406 | +_:b8 sp:varName "wellBore"^^xsd:string . |
1344 | - sp:varName "t0b"^^xsd:string . | ||
1345 | 1407 | ||
1346 | -_:b24 | 1408 | +_:b9 sp:varName "licence"^^xsd:string . |
1347 | - sp:varName "t0a"^^xsd:string . | ||
1348 | 1409 | ||
1349 | -_:b23 | 1410 | +_:b10 |
1350 | - sp:varName "s2"^^xsd:string . | 1411 | + sp:varName "share"^^xsd:string . |
1351 | 1412 | ||
1352 | -_:b22 | 1413 | +_:b11 |
1353 | - sp:varName "s1"^^xsd:string . | 1414 | + sp:varName "wellBore"^^xsd:string . |
1354 | 1415 | ||
1355 | -_:b21 | 1416 | +_:b12 |
1356 | - sp:varName "normalizedStr"^^xsd:string . | 1417 | + sp:varName "share"^^xsd:string . |
1357 | 1418 | ||
1358 | -_:b20 | 1419 | +_:b13 |
1359 | sp:varName "licence"^^xsd:string . | 1420 | sp:varName "licence"^^xsd:string . |
1360 | 1421 | ||
1361 | -_:b19 | 1422 | +_:b14 |
1362 | - sp:varName "reif"^^xsd:string . | ||
1363 | - | ||
1364 | -_:b18 | ||
1365 | - sp:varName "value"^^xsd:string . | ||
1366 | - | ||
1367 | -_:b17 | ||
1368 | - sp:varName "wellBore"^^xsd:string . | ||
1369 | - | ||
1370 | -_:b16 | ||
1371 | sp:varName "company"^^xsd:string . | 1423 | sp:varName "company"^^xsd:string . |
1372 | 1424 | ||
1373 | _:b15 | 1425 | _:b15 |
1374 | sp:varName "companyName"^^xsd:string . | 1426 | sp:varName "companyName"^^xsd:string . |
1375 | 1427 | ||
1376 | -_:b14 | 1428 | +_:b16 |
1377 | sp:varName "company"^^xsd:string . | 1429 | sp:varName "company"^^xsd:string . |
1378 | 1430 | ||
1379 | -_:b13 | 1431 | +_:b17 |
1432 | + sp:varName "wellBore"^^xsd:string . | ||
1433 | + | ||
1434 | +_:b18 | ||
1435 | + sp:varName "value"^^xsd:string . | ||
1436 | + | ||
1437 | +_:b19 | ||
1438 | + sp:varName "reif"^^xsd:string . | ||
1439 | + | ||
1440 | +_:b20 | ||
1380 | sp:varName "licence"^^xsd:string . | 1441 | sp:varName "licence"^^xsd:string . |
1381 | 1442 | ||
1382 | -_:b12 | 1443 | +_:b21 |
1383 | - sp:varName "share"^^xsd:string . | 1444 | + sp:varName "normalizedStr"^^xsd:string . |
1384 | 1445 | ||
1385 | -_:b11 | 1446 | +_:b22 |
1386 | - sp:varName "wellBore"^^xsd:string . | 1447 | + sp:varName "s1"^^xsd:string . |
1387 | 1448 | ||
1388 | -_:b10 | 1449 | +_:b23 |
1389 | - sp:varName "share"^^xsd:string . | 1450 | + sp:varName "s2"^^xsd:string . |
1390 | 1451 | ||
1391 | -_:b9 sp:varName "licence"^^xsd:string . | 1452 | +_:b24 |
1453 | + sp:varName "t0a"^^xsd:string . | ||
1392 | 1454 | ||
1393 | -_:b8 sp:varName "wellBore"^^xsd:string . | 1455 | +_:b25 |
1456 | + sp:varName "t0b"^^xsd:string . | ||
1394 | 1457 | ||
1395 | -_:b7 sp:varName "company"^^xsd:string . | 1458 | +_:b26 |
1459 | + sp:varName "t1"^^xsd:string . | ||
1396 | 1460 | ||
1397 | -_:b6 sp:varName "well"^^xsd:string . | 1461 | +_:b27 |
1462 | + sp:varName "t2"^^xsd:string . | ||
1398 | 1463 | ||
1399 | -_:b5 sp:varName "wellName"^^xsd:string . | 1464 | +_:b28 |
1465 | + sp:varName "t3"^^xsd:string . | ||
1400 | 1466 | ||
1401 | -_:b4 sp:varName "wellBore"^^xsd:string . | 1467 | +_:b29 |
1468 | + sp:varName "t4"^^xsd:string . | ||
1402 | 1469 | ||
1403 | -_:b3 sp:varName "wellBoreId"^^xsd:string . | 1470 | +_:b30 |
1471 | + sp:varName "id"^^xsd:string . | ||
1404 | 1472 | ||
1405 | -_:b2 sp:varName "wellBoreName"^^xsd:string . | 1473 | +_:b31 |
1474 | + sp:varName "name"^^xsd:string . | ||
1406 | 1475 | ||
1407 | -_:b1 sp:varName "subject"^^xsd:string . | 1476 | +_:b32 |
1477 | + sp:varName "wellBore"^^xsd:string . | ... | ... |
-
Please register or login to post a comment