|
@@ -14,6 +14,7 @@ import {
|
|
|
DropdownItem,
|
|
|
DropdownMenu,
|
|
|
DropdownToggle,
|
|
|
+ Spinner,
|
|
|
Media
|
|
|
} from 'reactstrap';
|
|
|
import { connect } from 'react-redux';
|
|
@@ -33,6 +34,9 @@ import { get1SpatialAssessmentMetrics } from '../../../services/tripleStoreAPIs/
|
|
|
import { get1SpatialAssessmentData } from '../../../services/tripleStoreAPIs/sparql/get1SpatialAssessmentData';
|
|
|
import { get1SpatialDimensions } from '../../../services/tripleStoreAPIs/sparql/get1SpatialDimensions';
|
|
|
import { get1SpatialMappings } from '../../../services/tripleStoreAPIs/sparql/get1SpatialMappings';
|
|
|
+import { getPrime2Desc } from '../../../services/tripleStoreAPIs/sparql/getPrime2Desc';
|
|
|
+import { getMRDSDesc } from '../../../services/tripleStoreAPIs/sparql/getMRDSDesc';
|
|
|
+import { getLinkedDataDesc } from '../../../services/tripleStoreAPIs/sparql/getLinkedDataDesc';
|
|
|
import metricExceptionMapping from '../../../config/metricKnowledgeBaseMapping';
|
|
|
import uploadImage from '../../../assets/cloud-upload.png'
|
|
|
|
|
@@ -55,7 +59,11 @@ class DataSetLarge extends Component {
|
|
|
datasetID:this.props.datasetID,
|
|
|
dataset: this.props.dataSetDetails,
|
|
|
hasDataset: false,
|
|
|
- showGraphSelect: false
|
|
|
+ showGraphSelect: false,
|
|
|
+ prime2Desc: [],
|
|
|
+ linkedDataDesc: [],
|
|
|
+ mrdsDesc: [],
|
|
|
+
|
|
|
};
|
|
|
|
|
|
recall = 0;
|
|
@@ -68,6 +76,16 @@ class DataSetLarge extends Component {
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
+ this.pipelineDescriptions()
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ pipelineDescriptions = async() =>
|
|
|
+ {
|
|
|
+ let prime2Desc = await this.fetchPrime2Desc()
|
|
|
+ let mrdsDesc = await this.fetchMRDSDesc()
|
|
|
+ let linkedDataDesc = await this.fetchLinkedDataDesc()
|
|
|
+ this.setState({prime2Desc: prime2Desc, mrdsDesc: mrdsDesc, linkedDataDesc: linkedDataDesc})
|
|
|
}
|
|
|
|
|
|
componentWillUnmount() {
|
|
@@ -115,12 +133,12 @@ class DataSetLarge extends Component {
|
|
|
//Makes SPARQL queries and adds data to dataset
|
|
|
setup = async(graphName) =>
|
|
|
{
|
|
|
+
|
|
|
let datasetDetails = await this.initialize1Spatial();
|
|
|
let metrics = await this.fetch1SpatialMetrics()
|
|
|
let assessmentData = await this.fetch1SpatialAssessmentData(graphName)
|
|
|
let dimensionData = await this.fetch1SpatialDimensions(graphName)
|
|
|
let mappingData = await this.fetch1SpatialMappings()
|
|
|
- console.log(assessmentData)
|
|
|
datasetDetails.assessmentMetrics = metrics
|
|
|
datasetDetails.historicAssessmentData = assessmentData.historicAssessmentData
|
|
|
datasetDetails.dataSetLastAssessed = assessmentData.dataSetLastAssessed
|
|
@@ -342,6 +360,90 @@ class DataSetLarge extends Component {
|
|
|
return graphs
|
|
|
}
|
|
|
|
|
|
+ fetchPrime2DescFromTripleStore = () =>
|
|
|
+ {
|
|
|
+ return new Promise((resolve)=>{
|
|
|
+ let spatialmetrics = [];
|
|
|
+ read(getPrime2Desc())
|
|
|
+ .then((response) => {
|
|
|
+ //console.log(response);
|
|
|
+ if (response) {
|
|
|
+ if (response.results.bindings.length > 0) {
|
|
|
+ spatialmetrics = response.results.bindings.map((result,index) => {
|
|
|
+ return ({result:result});
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resolve(spatialmetrics);
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ fetchPrime2Desc = async() =>
|
|
|
+ {
|
|
|
+ let definedMetrics = Object.keys(metricExceptionMapping.knowledgeBaseMapping);
|
|
|
+ let response = await this.fetchPrime2DescFromTripleStore()
|
|
|
+ let graphs = response;
|
|
|
+ return graphs
|
|
|
+ }
|
|
|
+
|
|
|
+ fetchMRDSDescFromTripleStore = () =>
|
|
|
+ {
|
|
|
+ return new Promise((resolve)=>{
|
|
|
+ let spatialmetrics = [];
|
|
|
+ read(getMRDSDesc())
|
|
|
+ .then((response) => {
|
|
|
+ //console.log(response);
|
|
|
+ if (response) {
|
|
|
+ if (response.results.bindings.length > 0) {
|
|
|
+ spatialmetrics = response.results.bindings.map((result,index) => {
|
|
|
+ return ({result:result});
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resolve(spatialmetrics);
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ fetchMRDSDesc = async() =>
|
|
|
+ {
|
|
|
+ let definedMetrics = Object.keys(metricExceptionMapping.knowledgeBaseMapping);
|
|
|
+ let response = await this.fetchMRDSDescFromTripleStore()
|
|
|
+ let graphs = response;
|
|
|
+ return graphs
|
|
|
+ }
|
|
|
+
|
|
|
+ fetchLinkedDataDescFromTripleStore = () =>
|
|
|
+ {
|
|
|
+ return new Promise((resolve)=>{
|
|
|
+ let spatialmetrics = [];
|
|
|
+ read(getLinkedDataDesc())
|
|
|
+ .then((response) => {
|
|
|
+ //console.log(response);
|
|
|
+ if (response) {
|
|
|
+ if (response.results.bindings.length > 0) {
|
|
|
+ spatialmetrics = response.results.bindings.map((result,index) => {
|
|
|
+ return ({result:result});
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resolve(spatialmetrics);
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ fetchLinkedDataDesc = async() =>
|
|
|
+ {
|
|
|
+ let definedMetrics = Object.keys(metricExceptionMapping.knowledgeBaseMapping);
|
|
|
+ let response = await this.fetchLinkedDataDescFromTripleStore()
|
|
|
+ let graphs = response;
|
|
|
+ return graphs
|
|
|
+ }
|
|
|
+
|
|
|
//Creates dataset object
|
|
|
initialize1Spatial = () => {
|
|
|
let requestBody = {
|
|
@@ -429,7 +531,6 @@ class DataSetLarge extends Component {
|
|
|
if(sessionStore){
|
|
|
if(sessionStore[this.props.pipelineNum]){
|
|
|
percentageValue = Number.parseFloat(sessionStore[this.props.pipelineNum].lastAssessmentQuality * 100).toFixed(2);
|
|
|
- //console.log(percentageValue);
|
|
|
|
|
|
if ((sessionStore[this.props.pipelineNum]).lastAssessmentQuality >= (sessionStore[this.props.pipelineNum]).expectedProgress) {
|
|
|
canPublish = "Ready to Publish";
|
|
@@ -448,23 +549,37 @@ class DataSetLarge extends Component {
|
|
|
styleCard = "text-white bg-info text-center w-100 h-90 pipelineTiles "
|
|
|
styleText = "text-value font-weight-bold text-dark text-center text-truncate cardTextDown"
|
|
|
}
|
|
|
- if(sessionStore[this.props.pipelineNum])
|
|
|
+ if(sessionStore[this.props.pipelineNum] && this.state.linkedDataDesc.length > 0)
|
|
|
{
|
|
|
+ var nodeDescription = ''
|
|
|
+ if(this.state.datasetID == 'Prime2'){
|
|
|
+ var nodeDescription = this.state.prime2Desc
|
|
|
+ }else{
|
|
|
+ var nodeDescription = this.state.mrdsDesc
|
|
|
+ }
|
|
|
+
|
|
|
link = (<Link to={{ pathname: this.props.link+ "/" +this.props.pipelineNum }}>
|
|
|
- <CardTitle className={styleText}>{this.state.datasetID}</CardTitle>
|
|
|
+ <CardTitle className={styleText} style={{whiteSpace: 'pre-wrap', overflowWrap: 'break-word', fontSize: '1.1rem'}}>{nodeDescription[0].result['title'].value}</CardTitle>
|
|
|
<div style={{ width: '150px', margin: 'auto' }}>
|
|
|
{progressBar}
|
|
|
- </div>
|
|
|
+ </div><br/>
|
|
|
+ <CardText className="text-dark"><b>Description : </b>{nodeDescription[0].result['desc'].value}</CardText>
|
|
|
+ <CardText className="text-dark"><b>Last Modified : </b>{nodeDescription[0].result['modified'].value}</CardText>
|
|
|
+ <CardText className="text-dark"><b>Derived From : </b>{nodeDescription[0].result['derived'].value}</CardText>
|
|
|
<br />
|
|
|
</Link>);
|
|
|
}
|
|
|
- else if(this.props.link !== 'onespatial')
|
|
|
- {
|
|
|
+ else if(this.props.link !== 'onespatial' && this.state.linkedDataDesc.length > 0)
|
|
|
+ {
|
|
|
+ var nodeDescription = this.state.linkedDataDesc
|
|
|
link = (<Link to={{ pathname: this.props.link }}>
|
|
|
- <CardTitle className={styleText}>{this.state.datasetID}</CardTitle>
|
|
|
+ <CardTitle className={styleText}>{nodeDescription[0].result['title'].value}</CardTitle>
|
|
|
<div style={{ width: '150px', margin: 'auto' }}>
|
|
|
{progressBar}
|
|
|
- </div>
|
|
|
+ </div><br/><br/><br/><br/><br/><br/>
|
|
|
+ <CardText className="text-dark"><b>Description : </b>{nodeDescription[0].result['desc'].value}</CardText>
|
|
|
+ <CardText className="text-dark"><b>Last Modified : </b>{nodeDescription[0].result['modified'].value}</CardText>
|
|
|
+ <CardText className="text-dark"><b>Derived From : </b>{nodeDescription[0].result['derived'].value}</CardText>
|
|
|
<br />
|
|
|
</Link>);
|
|
|
}
|