Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Likely incorrect nodegroup leads to a NullPointerException #14

Open
Ptival opened this issue Mar 10, 2021 · 1 comment
Open

Likely incorrect nodegroup leads to a NullPointerException #14

Ptival opened this issue Mar 10, 2021 · 1 comment

Comments

@Ptival
Copy link
Collaborator

Ptival commented Mar 10, 2021

Raisin this issue because it might be an unintended error. As I work on a migration tool for nodegroups, I end up producing partially-repaired nodegroups that are likely incorrect, but in ways I do not quite know.

So far, I have been able to load them in SemTK to get useful error messages about mentions of classes / properties that don't exist in the ontology.

But with one of my recent changes, I am now seeing this exception:

http://localhost:12058/nodeGroupExecution/ingestFromCsvStringsById: Rest service call did not succeed
Details:
b'"message":"operations failed."
"rationale":"ingestion/fromCsv* threw java.lang.NullPointerException null
com.ge.research.semtk.belmont.NodeGroup.addJsonEncodedNodeGroup(NodeGroup.java:689)
com.ge.research.semtk.belmont.NodeGroup.getInstanceFromJson(NodeGroup.java:137)
com.ge.research.semtk.load.utility.SparqlGraphJson.getNodeGroup(SparqlGraphJson.java:294)

It seems a bit more catastrophic than the previous error messages I got, so it might be a candidate for a catch with some more explicit error message.

If more details would be useful:

Click for details
{
  "version": 2,
  "sparqlConn": {
    "name": "RACK local fuseki",
    "domain": "",
    "enableOwlImports": true,
    "model": [
      {
        "type": "fuseki",
        "url": "http://localhost:3030/RACK",
        "graph": "http://rack001/model"
      }
    ],
    "data": [
      {
        "type": "fuseki",
        "url": "http://localhost:3030/RACK",
        "graph": "http://rack001/data"
      }
    ]
  },
  "sNodeGroup": {
    "version": 11,
    "limit": 0,
    "offset": 0,
    "sNodeList": [
      {
        "deletionMode": "NO_DELETE",
        "fullURIName": "http://Turnstile/DevelopmentPlan#LowLevelRequirement",
        "instanceValue": null,
        "isReturned": true,
        "isRuntimeConstrained": false,
        "nodeList": [],
        "NodeName": "LowLevelRequirement",
        "propList": [
          {
            "KeyName": "identifier",
            "ValueType": "string",
            "relationship": "http://www.w3.org/2001/XMLSchema#string",
            "UriRelationship": "http://arcos.rack/PROV-S#identifier",
            "Constraints": "",
            "fullURIName": "",
            "SparqlID": "?identifier_ProducingLowLevelRequirement",
            "isReturned": true,
            "optMinus": 0,
            "isRuntimeConstrained": false,
            "instanceValues": [],
            "isMarkedForDeletion": false
          }
        ],
        "SparqlID": "?ProducingLowLevelRequirement",
        "subClassNames": [],
        "valueConstraint": ""
      },
      {
        "deletionMode": "NO_DELETE",
        "fullURIName": "http://Turnstile/DevelopmentPlan#SoftwareDesign",
        "instanceValue": null,
        "isReturned": false,
        "isRuntimeConstrained": false,
        "nodeList": [],
        "NodeName": "SoftwareDesign",
        "propList": [
          {
            "KeyName": "identifier",
            "ValueType": "string",
            "relationship": "http://www.w3.org/2001/XMLSchema#string",
            "UriRelationship": "http://arcos.rack/PROV-S#identifier",
            "Constraints": "",
            "fullURIName": "",
            "SparqlID": "?identifier_SoftwareDesign",
            "isReturned": true,
            "optMinus": 0,
            "isRuntimeConstrained": false,
            "instanceValues": [],
            "isMarkedForDeletion": false
          }
        ],
        "SparqlID": "?SoftwareDesign",
        "subClassNames": [],
        "valueConstraint": ""
      },
      {
        "deletionMode": "NO_DELETE",
        "fullURIName": "http://Turnstile/DevelopmentPlan#LowLevelRequirement",
        "instanceValue": null,
        "isReturned": true,
        "isRuntimeConstrained": false,
        "nodeList": [],
        "NodeName": "LowLevelRequirement",
        "propList": [
          {
            "KeyName": "identifier",
            "ValueType": "string",
            "relationship": "http://www.w3.org/2001/XMLSchema#string",
            "UriRelationship": "http://arcos.rack/PROV-S#identifier",
            "Constraints": "",
            "fullURIName": "",
            "SparqlID": "?identifier_ConsumingLowLevelRequirement",
            "isReturned": true,
            "optMinus": 0,
            "isRuntimeConstrained": false,
            "instanceValues": [],
            "isMarkedForDeletion": false
          }
        ],
        "SparqlID": "?ConsumingLowLevelRequirement",
        "subClassNames": [],
        "valueConstraint": ""
      },
      {
        "deletionMode": "NO_DELETE",
        "fullURIName": "http://Turnstile/DevelopmentPlan#DataAndControlCouple",
        "instanceValue": null,
        "isReturned": false,
        "isRuntimeConstrained": false,
        "nodeList": [
          {
            "SnodeSparqlIDs": [
              "?ConsumingLowLevelRequirement"
            ],
            "OptionalMinus": [
              1
            ],
            "Qualifiers": [
              ""
            ],
            "DeletionMarkers": [
              false
            ],
            "KeyName": "consumedBy",
            "ValueType": "ENTITY",
            "UriValueType": "http://arcos.rack/PROV-S#ENTITY",
            "ConnectBy": "consumedBy",
            "Connected": true,
            "UriConnectBy": "http://arcos.rack/REQUIREMENTS#consumedBy"
          },
          {
            "SnodeSparqlIDs": [
              "?SoftwareDesign"
            ],
            "OptionalMinus": [
              1
            ],
            "Qualifiers": [
              ""
            ],
            "DeletionMarkers": [
              false
            ],
            "KeyName": "createdBy",
            "ValueType": "ACTIVITY",
            "UriValueType": "http://arcos.rack/PROV-S#ACTIVITY",
            "ConnectBy": "createdBy",
            "Connected": true,
            "UriConnectBy": "http://arcos.rack/REQUIREMENTS#createdBy"
          },
          {
            "SnodeSparqlIDs": [
              "?ProducingLowLevelRequirement"
            ],
            "OptionalMinus": [
              1
            ],
            "Qualifiers": [
              ""
            ],
            "DeletionMarkers": [
              false
            ],
            "KeyName": "providedBy",
            "ValueType": "ENTITY",
            "UriValueType": "http://arcos.rack/PROV-S#ENTITY",
            "ConnectBy": "providedBy",
            "Connected": true,
            "UriConnectBy": "http://arcos.rack/REQUIREMENTS#providedBy"
          }
        ],
        "NodeName": "DataAndControlCouple",
        "propList": [
          {
            "KeyName": "identifier",
            "ValueType": "string",
            "relationship": "http://www.w3.org/2001/XMLSchema#string",
            "UriRelationship": "http://arcos.rack/PROV-S#identifier",
            "Constraints": "",
            "fullURIName": "",
            "SparqlID": "?identifier_DataAndControlCouple",
            "isReturned": true,
            "optMinus": 0,
            "isRuntimeConstrained": false,
            "instanceValues": [],
            "isMarkedForDeletion": false
          },
          {
            "KeyName": "description",
            "ValueType": "string",
            "relationship": "http://www.w3.org/2001/XMLSchema#string",
            "UriRelationship": "http://arcos.rack/PROV-S#description",
            "Constraints": "",
            "fullURIName": "",
            "SparqlID": "?text_DataAndControlCouple",
            "isReturned": true,
            "optMinus": 1,
            "isRuntimeConstrained": false,
            "instanceValues": [],
            "isMarkedForDeletion": false
          }
        ],
        "SparqlID": "?DataAndControlCouple",
        "subClassNames": [],
        "valueConstraint": ""
      }
    ],
    "orderBy": [],
    "unionHash": null
  },
  "importSpec": {
    "version": 1,
    "baseURI": "",
    "columns": [
      {
        "colId": "col_0",
        "colName": "identifier_ProducingLowLevelRequirement"
      },
      {
        "colId": "col_1",
        "colName": "identifier_SoftwareDesign"
      },
      {
        "colId": "col_2",
        "colName": "identifier_ConsumingLowLevelRequirement"
      },
      {
        "colId": "col_3",
        "colName": "identifier_DataAndControlCouple"
      },
      {
        "colId": "col_4",
        "colName": "text_DataAndControlCouple"
      }
    ],
    "dataValidator": [],
    "texts": [],
    "transforms": [
      {
        "transId": "trans_0",
        "name": "RemoveNulls",
        "transType": "replaceAll",
        "arg1": "null",
        "arg2": ""
      }
    ],
    "nodes": [
      {
        "sparqlID": "?ProducingLowLevelRequirement",
        "type": "http://Turnstile/DevelopmentPlan#LowLevelRequirement",
        "URILookupMode": "createIfMissing",
        "mapping": [],
        "props": [
          {
            "mapping": [
              {
                "colId": "col_0",
                "colName": null
              }
            ],
            "URILookup": [
              "?ProducingLowLevelRequirement"
            ],
            "URIRelation": "http://arcos.rack/PROV-S#identifier"
          }
        ]
      },
      {
        "sparqlID": "?SoftwareDesign",
        "type": "http://Turnstile/DevelopmentPlan#SoftwareDesign",
        "URILookupMode": "createIfMissing",
        "mapping": [],
        "props": [
          {
            "mapping": [
              {
                "colId": "col_1",
                "colName": null
              }
            ],
            "URILookup": [
              "?SoftwareDesign"
            ],
            "URIRelation": "http://arcos.rack/PROV-S#identifier"
          }
        ]
      },
      {
        "sparqlID": "?ConsumingLowLevelRequirement",
        "type": "http://Turnstile/DevelopmentPlan#LowLevelRequirement",
        "URILookupMode": "createIfMissing",
        "mapping": [],
        "props": [
          {
            "mapping": [
              {
                "colId": "col_2",
                "colName": null
              }
            ],
            "URILookup": [
              "?ConsumingLowLevelRequirement"
            ],
            "URIRelation": "http://arcos.rack/PROV-S#identifier"
          }
        ]
      },
      {
        "sparqlID": "?DataAndControlCouple",
        "type": "http://Turnstile/DevelopmentPlan#DataAndControlCouple",
        "URILookupMode": "createIfMissing",
        "mapping": [],
        "props": [
          {
            "mapping": [
              {
                "colId": "col_3",
                "colName": null
              }
            ],
            "URILookup": [
              "?DataAndControlCouple"
            ],
            "URIRelation": "http://arcos.rack/PROV-S#identifier"
          },
          {
            "mapping": [
              {
                "colId": "col_4",
                "colName": null
              }
            ],
            "URILookup": null,
            "URIRelation": "http://arcos.rack/PROV-S#description"
          }
        ]
      }
    ]
  }
}
@cuddihyge
Copy link
Collaborator

In the short term, neither colName nor URILookup (see the end of your file) should ever by null. URILookup should be [].

I can patch these things as they come up.

But properly verifying the JSON to support editing mistakes will be a non-trivial task. It would be nice to at least give a generic "JSON is bad" message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants