@igea/oac_backend 1.0.41 → 1.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igea/oac_backend",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "Backend service for the OAC project",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "exposed":{
35
35
  "protocol": "http",
36
- "host": "localhost",
36
+ "host": "127.0.0.1",
37
37
  "port": "4000"
38
38
  }
39
39
 
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "exposed":{
35
35
  "protocol": "http",
36
- "host": "localhost",
36
+ "host": "127.0.0.1",
37
37
  "port": "4000"
38
38
  }
39
39
  }
@@ -37,6 +37,13 @@ module.exports = function(jwtLib){
37
37
  });
38
38
  }
39
39
 
40
+ router.get('/exposed_config', (req, res) => {
41
+ res.json({
42
+ success: true,
43
+ data: EXPOSED
44
+ });
45
+ });
46
+
40
47
  router.post('/authenticate', authLimiter, (req, res) => {
41
48
  console.log("here authenticate")
42
49
  let body = req.body
@@ -69,7 +69,7 @@ class Parser{
69
69
  reject(err)
70
70
  }else{
71
71
  var terms = stdout.split('\n')
72
- resolve(terms.map(line => line.trim()).filter(line => line.length > 0));
72
+ resolve(terms.map(line => line.trim().replace(/\s+/g, ' ')).filter(line => line.length > 0));
73
73
  }
74
74
  });
75
75
  }catch(e){
@@ -22,6 +22,7 @@
22
22
  <xs:sequence>
23
23
  <xs:element name="term" type="termType"/>
24
24
  </xs:sequence>
25
+ <xs:attribute name="class" type="xs:string" default="crm:E55_Type" use="optional"/>
25
26
  </xs:complexType>
26
27
  </xs:element>
27
28
  </xs:sequence>
@@ -20,24 +20,52 @@
20
20
  <!-- Vocabolario -->
21
21
  <xsl:template match="vocabulary">
22
22
  <xsl:param name="prefix"/>
23
+
24
+ <!-- Recupero classe, di default crm:E55_Type -->
25
+ <xsl:variable name="type-class" select="normalize-space(@class)"/>
26
+ <!-- xsl:variable name="type" select="'crm:E55_Type'"/ -->
27
+
28
+ <!-- xsl:variable name="type">
29
+ <xsl:choose>
30
+ <xsl:when test="string-length($type-class) &gt; 0">
31
+ <xsl:value-of select="normalize-space($type-class)"/>
32
+ </xsl:when>
33
+ <xsl:otherwise>crm:E55_Type</xsl:otherwise>
34
+ </xsl:choose>
35
+ </xsl:variable -->
36
+
37
+ <xsl:variable name="type">
38
+ <xsl:if test="string-length($type-class) = 0">
39
+ <xsl:value-of select="'crm:E55_Type'"/>
40
+ </xsl:if>
41
+ <xsl:if test="not(string-length($type-class)) = 0">
42
+ <xsl:value-of select="concat($type-class, ' ')"/>
43
+ </xsl:if>
44
+ </xsl:variable>
45
+
23
46
  <xsl:variable name="vocab-id" select="normalize-space(@id)"/>
24
47
  <xsl:apply-templates select="term">
25
48
  <xsl:with-param name="path" select="concat('http://', $prefix, $vocab-id)"/>
49
+ <xsl:with-param name="type" select="concat($type, ' ')"/>
26
50
  </xsl:apply-templates>
27
51
  </xsl:template>
28
52
 
29
53
  <!-- Term ricorsivo -->
30
54
  <xsl:template match="term">
31
55
  <xsl:param name="path"/>
56
+ <xsl:param name="type"/>
32
57
  <xsl:variable name="current-id" select="normalize-space(@id)"/>
33
58
  <xsl:variable name="new-path" select="concat($path, '/', $current-id)"/>
59
+ <xsl:variable name="new-type" select="concat($type, ' ')"/>
34
60
 
35
61
  <xsl:choose>
36
62
  <!-- Se NON ha sub-terms/term -->
37
63
  <xsl:when test="not(sub-terms/term)">
38
64
  <xsl:for-each select="name">
39
65
  <xsl:value-of select="concat('&lt;',$new-path,'&gt;')"/>
40
- <xsl:text> a crm:E55_Type rdfs:label "</xsl:text>
66
+ <xsl:text> a </xsl:text>
67
+ <xsl:value-of select="concat($new-type, ' ')"/>
68
+ <xsl:text> rdfs:label "</xsl:text>
41
69
  <xsl:value-of select="."/>
42
70
  <xsl:text>"@</xsl:text>
43
71
  <xsl:value-of select="@lang"/>
@@ -53,7 +81,9 @@
53
81
 
54
82
  <xsl:for-each select="name">
55
83
  <xsl:value-of select="concat('&lt;',$npath,'&gt;')"/>
56
- <xsl:text> a crm:E55_Type rdfs:label "</xsl:text>
84
+ <xsl:text> a </xsl:text>
85
+ <xsl:value-of select="concat($new-type, ' ')"/>
86
+ <xsl:text> rdfs:label "</xsl:text>
57
87
  <xsl:value-of select="."/>
58
88
  <xsl:text>"@</xsl:text>
59
89
  <xsl:value-of select="@lang"/>
@@ -65,6 +95,7 @@
65
95
  <xsl:apply-templates select="sub-terms/term">
66
96
  <xsl:with-param name="prev-path" select="$path"/>
67
97
  <xsl:with-param name="path" select="$new-path"/>
98
+ <xsl:with-param name="type" select="$type"/>
68
99
  </xsl:apply-templates>
69
100
  </xsl:otherwise>
70
101
  </xsl:choose>
@@ -7,7 +7,7 @@
7
7
  -->
8
8
 
9
9
  <!-- Vocabolario per CONDIZIONI AMBIENTALI (1) -->
10
- <vocabulary>
10
+ <vocabulary class="crm:E55_Type">
11
11
  <term id="condizioni-ambientali">
12
12
  <name lang="it">Condizioni ambientali</name>
13
13
  <sub-terms>
@@ -73,7 +73,7 @@
73
73
  </vocabulary>
74
74
 
75
75
  <!-- Vocabolario per DEGRADO (3) -->
76
- <vocabulary>
76
+ <vocabulary class="basecpm:CP42_Material_Decay">
77
77
  <term id="degrado">
78
78
  <name lang="it">Degrado</name>
79
79
  <sub-terms>
@@ -19,6 +19,7 @@
19
19
  <xs:sequence>
20
20
  <xs:element name="term" type="termType"/>
21
21
  </xs:sequence>
22
+ <xs:attribute name="class" type="xs:string" default="crm:E55_Type" use="optional"/>
22
23
  </xs:complexType>
23
24
  </xs:element>
24
25
  </xs:sequence>