@@ -54,6 +54,18 @@ export function createGitHubIssue(repo: string, title: string, body: string, ass
54
54
window . open ( `${ repo } /issues/new?title=${ encodeURIComponent ( title ) } &body=${ encodedBody } &assignees=${ assignee } &labels=${ label } ` ) ;
55
55
}
56
56
57
+ /**
58
+ /** Open a new issue on the GitHub repository using the given template.
59
+ * @param repo - GIT repository URL
60
+ * @param title - issue title
61
+ * @param template - template filename without the .yml extension
62
+ * @param fields - form field keys and string values
63
+ */
64
+ export function createGitHubTemplateIssue ( repo : string , title : string , template : string , fields : [ string , string ] [ ] ) : void {
65
+ const encodedFields = fields . map ( ( [ key , value ] ) => `&${ key } =${ encodeURIComponent ( value ) } ` ) . reduce ( ( a , b ) => a + b ) ;
66
+ window . open ( `${ repo } /issues/new?template=${ template } .yml&title=${ encodeURIComponent ( title ) } ${ encodedFields } ` ) ;
67
+ }
68
+
57
69
/**
58
70
* Prompts creation of an issue on GitHub with the label specified in `config.git.issueLabels.deleteNode` and the default assignee to remove the given node.
59
71
* @param node The node which is to be removed
@@ -109,22 +121,22 @@ ${language.CONSTANTS.SPARUL_WARNING}`;
109
121
*/
110
122
export function createGitHubConfirmLinkIssue ( edge : EdgeSingular ) {
111
123
edge . data ( EDGE . GRAPH , "http://www.snik.eu/ontology/match" ) ;
112
- const body = `Please confirm the automatic interlink ${ edgeLabel ( edge ) } :
124
+ const source = edge . data ( EDGE . SOURCE ) ;
125
+ const target = edge . data ( EDGE . TARGET ) ;
126
+ const property = edge . data ( EDGE . PROPERTY ) ;
127
+ const triple = `{<${ source } > <${ property } > <${ target } >.}` ;
128
+ const sparql = `Confirm on the SPARQL endpoint via:
113
129
\`\`\`sparql
114
- DELETE DATA FROM <http://www.snik.eu/ontology/limes-exact>
115
- {<${ edge . data ( EDGE . SOURCE ) } > <${ edge . data ( EDGE . PROPERTY ) } > <${ edge . data ( EDGE . TARGET ) } >.}
116
- INSERT DATA INTO <http://www.snik.eu/ontology/match>
117
- {<${ edge . data ( EDGE . SOURCE ) } > <${ edge . data ( EDGE . PROPERTY ) } > <${ edge . data ( EDGE . TARGET ) } >.}
130
+ DELETE DATA FROM <http://www.snik.eu/ontology/limes-exact> ${ triple }
131
+ INSERT DATA INTO <http://www.snik.eu/ontology/match> ${ triple }
118
132
\`\`\`\n
119
133
Undo with
120
134
\`\`\`sparql
121
- DELETE DATA FROM <http://www.snik.eu/ontology/match>
122
- {<${ edge . data ( EDGE . SOURCE ) } > <${ edge . data ( EDGE . PROPERTY ) } > <${ edge . data ( EDGE . TARGET ) } >.}
123
- INSERT DATA INTO <http://www.snik.eu/ontology/limes-exact>
124
- {<${ edge . data ( EDGE . SOURCE ) } > <${ edge . data ( EDGE . PROPERTY ) } > <${ edge . data ( EDGE . TARGET ) } >.}
135
+ DELETE DATA FROM <http://www.snik.eu/ontology/match> ${ triple }
136
+ INSERT DATA INTO <http://www.snik.eu/ontology/limes-exact> ${ triple }
125
137
\n\`\`\`\n
126
138
${ language . CONSTANTS . SPARUL_WARNING } `;
127
- createGitHubIssue ( config . git . repo . ontology , edgeLabel ( edge ) , body , undefined , config . git . issueLabels . confirmLink ) ;
139
+ createGitHubTemplateIssue ( config . git . repo . application , "Confirm " + edgeLabel ( edge ) , "link" , Object . entries ( { source , target , sparql } ) ) ;
128
140
}
129
141
130
142
/** Creates a human readable string of the triple that an edge represents.
0 commit comments