Hi Mark,
Welcome to the community. It seems like your idea should work given a mappings file like:
{somekey} a prefix:Entity ;
prefix:term staticns:{termfragment} .
or
<{somekey}> a prefix:Entity ;
prefix:term staticns:{termfragment} .
but it's running into problems. I created an issue for that.
The work-around that I was able to find was to import the CSV into an RDBMS (I used Derby - comes with Java), and use R2RML for the mappings:
ij> CONNECT 'jdbc:derby://localhost:1527/iridb;create=true';
ij> create table "iritable" ( "somekey" varchar(50), "termfragment" varchar(50));
0 rows inserted/updated/deleted
ij> INSERT INTO "iritable" ("somekey","termfragment") VALUES ('http://stardog.com/example/pjacks', 'Paul Jackson');
1 row inserted/updated/deleted
mappings:
@prefix prefix: <http://example.com/prefix/> .
@prefix staticns: <http://example.com/staticns/> .
@prefix rr: <http://www.w3.org/ns/r2rml#> .
[] a rr:TriplesMap;
rr:logicalTable [ rr:tableName "\"iritable\"" ] ;
rr:subjectMap [ rr:column "\"somekey\"" ;
rr:termType rr:IRI ;
rr:class prefix:Entity ] ;
rr:predicateObjectMap [
rr:predicate prefix:term ;
rr:objectMap [ rr:template "staticns:{\"termfragment\"}" ]
] .
properties file:
jdbc.url=jdbc:derby://localhost:1527/iridb;create=true
jdbc.driver=org.apache.derby.jdbc.ClientDriver
jdbc.username=APP
# ignored
jdbc.password=APP
command-line:
stardog-admin virtual import -f r2rml mydb mydb.properties mycsv3.ttl
Hope that helps.
-Paul