Hi,

I would like to to specialize existing SM module, by binding some of its 
arguments. More concretely, i would like to create module 
my:ImportGoogleSpreadsheetCSV by extending module sml:ImportFileFromURL. 
my:ImportGoogleSpreadsheetCSV should have 2 additional parameters -- 
documentId and sheetId. This is my definition of the module :

my:ImportGoogleSpreadsheetCSV
  rdf:type sm:Module ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:predicate sml:documentId ;
      spl:valueType xsd:string ;
      rdfs:comment "Document Id."^^xsd:string ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:predicate sml:sheetId ;
      spl:valueType xsd:string ;
      rdfs:comment "Spreadsheet id."^^xsd:string ;
    ] ;
  spin:constructor [
      rdf:type sp:Construct ;
      sp:templates (
          [
            sp:object [
                sp:varName "url"^^xsd:string ;
              ] ;
            sp:predicate sml:url ;
            sp:subject spin:_this ;
          ]
        ) ;
      sp:text """CONSTRUCT {
   ?this sml:url ?url .
}
WHERE {
   BIND(CONCAT(\"https://docs.google.com/spreadsheets/d/\";, ?documentId, 
\"/export?format=csv&gid=\", ?sheetId) as ?url)    
}"""^^xsd:string ;
      sp:where (
          [
            rdf:type sp:Bind ;
            sp:expression [
                rdf:type sp:concat ;
                sp:arg1 "https://docs.google.com/spreadsheets/d/"; ;
                sp:arg2 [
                    sp:varName "documentId"^^xsd:string ;
                  ] ;
                sp:arg3 "/export?format=csv&gid=" ;
                sp:arg4 [
                    sp:varName "sheetId"^^xsd:string ;
                  ] ;
              ] ;
            sp:variable [
                sp:varName "url"^^xsd:string ;
              ] ;
          ]
        ) ;
    ] ;
  rdfs:label "Import CSV from Google Spreadsheet"^^xsd:string ;
  rdfs:subClassOf sml:ImportFileFromURL ;
.


Idea is to use CONCAT function to bind ?url in spin:constructor. However, 
 It gives me error: "Operation failed: 
org.topbraid.spin.sparqlmotion.modules.SMException: the string value is 
missing for url". This is clearly because sml:ImportFileFromURL module has 
"sml:url" argument which is required.

It there any way to disable required argument ? Is it correct way to do it 
? Are there any other options to do it ?

Cheers,
Peter


-- 
You received this message because you are subscribed to the Google Group 
"TopBraid Suite Users", the topics of which include the TopBraid Suite family 
of products and its base technologies such as SPARQLMotion, SPARQL Web Pages 
and SPIN.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to topbraid-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to