Generic column names in voicebox result set

Saved query runs just fine but in the VoicBox interface it returns columns such as:

  • Name
  • Name1
  • Name2

The select statement in my query is:
SELECT ?control ?controlName ?effectivenessScore ?implementationStatus ?asset ?assetName ?exposureValue ?risk ?riskLevel ?nistCode ?nistName

Any idea how to fix that?

Perhaps investigate not explicity querying ?controlName and ?assetName. (If you examine a query built by Explorer Query builder you’ll see that Labels are not explicitly requested in the query by default.)

Explorer and Voicebox make use of Stardog Label service

You can add the predicates for ?controlName and ?assetName to the database property label.properties. Then Voicebox will be be inclined to give you the label of returned IRIs.

Hm … crafting query in explorer did not help …

Here is the full query if that helps:
`PREFIX ocm: <http://www.w3.org/2019/05/ocm#>

SELECT ?control ?controlName ?effectivenessScore ?implementationStatus
?asset ?assetName ?exposureValue
?risk ?riskLevel
?nistCode ?nistName
WHERE {

Controls protecting assets

?control a ocm:OpenControlsCapability ;
ocm:name ?controlName ;
ocm:effectivenessScore ?effectivenessScore ;
ocm:implementationStatus ?implementationStatus ;
ocm:protects ?asset .

Assets with exposure value

?asset a ocm:BusinessProductAsset ;
ocm:name ?assetName ;
ocm:exposureValue ?exposureValue .

Risks mitigated by controls

OPTIONAL {
?control ocm:relatedTo ?risk .
?risk a ocm:Risk ;
ocm:riskLevel ?riskLevel .
}

NIST control mappings

OPTIONAL {
?control ocm:relatedTo ?nist .
?nist a ocm:RegulatoryObjective ;
ocm:framework "NIST" ;
ocm:code ?nistCode ;
ocm:name ?nistName .
}

Focus on high-value assets and weak controls

FILTER(?exposureValue > 50000000 && ?effectivenessScore < 85)
}
ORDER BY ?effectivenessScore DESC(?exposureValue)
LIMIT 25`

Perhaps investigate not explicity querying ?controlName and ?assetName. (If you examine a query built by Explorer Query builder you’ll see that Labels are not explicitly requested in the query by default.)

Explorer and Voicebox make use of Stardog Label service

You can add the predicates for ?controlName and ?assetName to the database property label.properties. Then Voicebox will be be inclined to give you the label of returned IRIs.

Ok - Not suggesting you write all your queries in Explorer (though you can implement OPTIONAL by using OR in query builder) but that you are aware and make use of the label service if appropriate.

Do you have attributes named Name, Name1, Name 2 in the dataset?

No I do not have Name, Name1, Name2 in my dataset

followed service label suggestons and and still - Name instead of Control Name is used :frowning:
what else can i do?


and the label property looks like that:

We make no guarantees about consistency of names used for variables in generated queries. There’s no reason for them to be the same between invocations, they have no semantics; the two versions of your query, one using ?name and the other using ?controlName are isomorphic.

If you want control over how result sets are displayed you should build a custom application that reflects the UX you are after. Our MCP and Langchain integrations make this easy.

Mike,

Thanks for your reply. So, you are saying that no matter how I tweak the saved queries voicebox will make it’s own mind how to name the variables in the generated queries, right?

MCP server wrapper around a Stardog knowledge graph is a good idea, indeed. I see that you will be presenting it on December 11 Building a Semantic Layer with MCP and LangChain for Agentic AI - looking forward to it.

Meanwhile I see an 8 months old repo GitHub - noahgorstein/mcp-server-stardog: A Model Context Protocol (MCP) Server for interacting with a Stardog Knowledge Graph. and it is is using stdio protocol - I believe that is when stardog mcp server and mcp client are collocated. In my case it is a cloud instance. It makes more sense to use http_streamable in this case. Not sure if that is supported. Or am I missing something?

Any updates on this thread above?

Also some strange behavior now. I have changed the order of the columns in the saved query - but the Voicbox refuses to update. What can be done?

Correct, it will use whatever variable names it deems appropriate. Same with the ordering of the variables in a projection, that holds no semantics whatsoever, so the agent is free to order them arbitrarily.

Yes our MCP server will support a remote setup.

1 Like