ontologies icon indicating copy to clipboard operation
ontologies copied to clipboard

TypeError: t is undefined thrown from termToNQ

Open pjworrall opened this issue 4 years ago • 4 comments

Should this work?

import rdf from "@ontologies/core"; import { name } from '@ontologies/schema'

rdf.quad(rdf.namedNode("https://interition.net/test#01") , name, rdf.literal("I am a pretty thing!"));

Because I get a TypeError: t is undefined thrown from termToNQ somewhere.

Maybe a newbie problem. TIA.

pjworrall avatar Jun 21 '21 11:06 pjworrall

Looks like that should work, though it is difficult to asses without a stacktrace and which factory you're using (The included PlainFactory, or another like MemoizedFactory, which would be present in package.json.

If quad raises this error, you're probably using something other then PlainFactory, and one of rdf.namedNode("https://interition.net/test#01"), name, or rdf.literal("I am a pretty thing!") is undefined.

If name is undefined, you can try import * as name from '@ontologies/schema'; and ....net/test#01"), schema.name, ...

rescribet avatar Jun 21 '21 13:06 rescribet

I hadn't specified any factory so it would have been PlainFactory. I thought all three arguments are defined as they are being declared implicitly. Name is coming from the import and I thought it was just a static decleration.

pjworrall avatar Jun 21 '21 13:06 pjworrall

Note that the link-solid-boilerplate sets MemoizedFactory during init.

Otherwise the PlainFactory doesn't use termToNQ, so the problem should be on another code path. But without any stacktrace or reproduction repo it'll be hard to tell

rescribet avatar Jun 21 '21 15:06 rescribet

I'll try and reproduce and get the stack trace on here. Thanks!

pjworrall avatar Jun 21 '21 15:06 pjworrall