-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4289eea
commit e62b9d7
Showing
17 changed files
with
266 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
version: "1.0" | ||
indexMode: INDEX_SPARQL_ENDPOINT | ||
sparqlEndpoint: http://virtuoso:8890/sparql | ||
indexFields: | ||
# COLLECTION LABEL | ||
- fieldName: label | ||
documentVariable: collection | ||
query: > | ||
SELECT DISTINCT ?collection ?label WHERE { | ||
GRAPH ?g { | ||
?collection a <https://dataid.dbpedia.org/databus#Collection>. | ||
?collection <http://purl.org/dc/terms/title> ?label. | ||
} | ||
#VALUES# | ||
} | ||
# COLLECTION ABSTRACT | ||
- fieldName: abstract | ||
documentVariable: collection | ||
query: > | ||
SELECT DISTINCT ?collection ?abstract WHERE { | ||
GRAPH ?g { | ||
?collection a <https://dataid.dbpedia.org/databus#Collection>. | ||
?collection <http://purl.org/dc/terms/abstract> ?abstract. | ||
} | ||
#VALUES# | ||
} | ||
# COLLECTION NAME | ||
- fieldName: part | ||
documentVariable: collection | ||
query: > | ||
SELECT ?collection ?part WHERE { | ||
GRAPH ?g { | ||
?collection a <https://dataid.dbpedia.org/databus#Collection>. | ||
?collection <https://dataid.dbpedia.org/databus#name> ?part . | ||
} | ||
#VALUES# | ||
} | ||
# PUBLISHER ACCOUNT NAME | ||
- fieldName: publisher | ||
documentVariable: collection | ||
query: > | ||
SELECT ?collection ?publisher WHERE { | ||
GRAPH ?g1 { | ||
?collection a <https://dataid.dbpedia.org/databus#Collection> . | ||
?collection <https://dataid.dbpedia.org/databus#account> ?account . | ||
} | ||
GRAPH ?g2 { | ||
?account <http://xmlns.com/foaf/0.1/accountName> ?publisher . | ||
} | ||
#VALUES# | ||
} | ||
# COLLECTIOn TYPE NAME | ||
- fieldName: typeName | ||
type: string | ||
documentVariable: collection | ||
query: > | ||
SELECT DISTINCT ?collection ?typeName WHERE { | ||
GRAPH ?g { | ||
?collection a <https://dataid.dbpedia.org/databus#Collection> . | ||
BIND("Collection" AS ?typeName) | ||
} | ||
#VALUES# | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const DatabusUris = require('../../../../public/js/utils/databus-uris'); | ||
const DatabusUtils = require('../../../../public/js/utils/databus-utils.js'); | ||
const JsonldUtils = require('../../../../public/js/utils/jsonld-utils.js'); | ||
const ResourceWriter = require('./resource-writer.js'); | ||
|
||
class CollectionWriter extends ResourceWriter { | ||
|
||
constructor(logger) { | ||
super(logger); | ||
} | ||
|
||
async onCreateGraphs() { | ||
|
||
var inputCollectionGraph = JsonldUtils.getGraphById(this.inputGraphs, this.uri); | ||
|
||
var collectionGraph = {}; | ||
collectionGraph[DatabusUris.JSONLD_ID] = this.uri; | ||
collectionGraph[DatabusUris.JSONLD_TYPE] = DatabusUris.DATABUS_COLLECTION; | ||
collectionGraph[DatabusUris.DATABUS_NAME] = this.resource.getArtifact(); | ||
collectionGraph[DatabusUris.DATABUS_ACCOUNT_PROPERTY] = JsonldUtils.refTo(this.resource.getAccountURI()); | ||
collectionGraph[DatabusUris.DATABUS_COLLECTION_CONTENT] = inputCollectionGraph[DatabusUris.DATABUS_COLLECTION_CONTENT]; | ||
|
||
if(inputCollectionGraph[DatabusUris.DCT_TITLE] != null) { | ||
collectionGraph[DatabusUris.DCT_TITLE] = inputCollectionGraph[DatabusUris.DCT_TITLE]; | ||
} | ||
|
||
if(inputCollectionGraph[DatabusUris.DCT_DESCRIPTION] != null) { | ||
collectionGraph[DatabusUris.DCT_DESCRIPTION] = inputCollectionGraph[DatabusUris.DCT_DESCRIPTION]; | ||
} | ||
|
||
if(inputCollectionGraph[DatabusUris.DCT_ABSTRACT] != null) { | ||
collectionGraph[DatabusUris.DCT_ABSTRACT] = inputCollectionGraph[DatabusUris.DCT_ABSTRACT]; | ||
} else if (collectionGraph[DatabusUris.DCT_DESCRIPTION] != null) { | ||
collectionGraph[DatabusUris.DCT_DESCRIPTION] = DatabusUtils.createAbstractFromDescription(collectionGraph[DatabusUris.DCT_DESCRIPTION]); | ||
} | ||
|
||
var groupGraph = {}; | ||
groupGraph[DatabusUris.JSONLD_ID] = this.resource.getGroupURI(); | ||
groupGraph[DatabusUris.JSONLD_TYPE] = DatabusUris.DATABUS_GROUP; | ||
|
||
return [ | ||
collectionGraph | ||
]; | ||
} | ||
|
||
getSHACLFilePath() { | ||
return './res/shacl/collection.shacl' | ||
} | ||
} | ||
|
||
module.exports = CollectionWriter; |
Oops, something went wrong.