So we are supposed to set up a "web Server" ontology on fuseki and access it via nodejs.
I created the dataset "data" and added my ontology via xml. Fuseki accepted it . This is the ontology :
<?xml version="1.0" encoding="utf-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:ns0="http://localhost:3000/data#">
<owl:DatatypeProperty rdf:about="http://localhost:3000/data#message">
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:about="http://localhost:3000/data#firstname">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
</owl:DatatypeProperty>
<owl:DatatypeProperty rdf:about="http://localhost:3000/data#lastname">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
</owl:DatatypeProperty>
<owl:Class rdf:about="http://localhost:3000/data#linkeddata">
<rdfs:comment>The class of all data types.</rdfs:comment>
<rdfs:label>The data type</rdfs:label>
</owl:Class>
<owl:Class rdf:about="http://localhost:3000/data#users">
<rdfs:comment>Users that post Tweets.</rdfs:comment>
<rdfs:label>Users</rdfs:label>
<rdfs:subClassOf rdf:resource="http://localhost:3000/data#linkeddata"/>
</owl:Class>
<owl:Class rdf:about="http://localhost:3000/data#tweets">
<rdfs:comment>Tweets contain messages of Users.</rdfs:comment>
<rdfs:label>Tweets</rdfs:label>
<rdfs:subClassOf rdf:resource="http://localhost:3000/data#linkeddata"/>
</owl:Class>
<owl:ObjectProperty rdf:about="http://localhost:3000/data#tweetedby">
</owl:ObjectProperty>
<rdf:Description rdf:about="http://localhost:3000/data#1234">
<rdf:type rdf:resource="http://localhost:3000/data#tweets"/>
<ns0:message>blablubbtweet</ns0:message>
<ns0:tweetedby>
<ns0:users rdf:about="http://localhost:3000/data#2345">
<ns0:firstname>Manuel</ns0:firstname>
<ns0:lastname>Neuer</ns0:lastname>
</ns0:users>
</ns0:tweetedby>
</rdf:Description>
</rdf:RDF>
I hope you can see that I created the classes "users" , "tweets" and "linkeddata" .
If I try view the data on the Fuseki server with the endpoint "/data/query" with following code its says "no data in table". Im expecting 27 Triples...what am I overlooking ?
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?class ?label ?description
WHERE {
?class a owl:class.
OPTIONAL { ?class rdfs:label ?label}
OPTIONAL { ?class rdfs:comment ?description}
}
Related
I try to find feature by id and layer id by WFS:
const cql_filter = "&cql_filter=(id=layer202103_geom.42)";
Request looks like:
service: WFS
version: 1.0.0
request: GetFeature
typeName: layer20_geom
outputFormat: json
cql_filter: (id=layer20_geom.42)
It returns me an error:
<?xml version="1.0" ?>
<ServiceExceptionReport
version="1.2.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException>
Could not parse CQL filter list.
Encountered "id =" at line 1, column 2.
Was expecting one of:
<NOT> ...
"include" ...
My full geojson looks:
{"type":"FeatureCollection","features":[{"type":"Feature","id":"layer2_geom.42","geometry":{"type":"Po...
I'm working with Spring Jpa Repositories.
I don't want to define my "named queries" in java classes (entities or repositories). I would like to define my "named queries" in different xml files (like orm.xml).
.... XML FILE ....
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd">
<named-query name="MyEntity.findByField1">
<query>
<![CDATA[
SELECT m
FROM MyEntity m
WHERE
m.field1 = :field1
]]>
</query>
</named-query>
</entity-mappings>
.... REPOSITORY CODE ....
public interface MyEntityRepository extends JpaRepository<MyEntity, String>
{
public Optional<MyEntity> findByField1(#Param("field1") String field1);
}
But my repositories are not finding the xml files with my named queries. How do I configure spring-data-jpa to use these xml files? I do not have a persistence.xml.
Thanks!
Since your MyEntity already has field1 property inside using findByField1 as the Repository method name might be confusing. Change the orm.xml as following and place it inside META-INF/orm.xml
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm http://xmlns.jcp.org/xml/ns/persistence/orm_2_1.xsd">
<named-query name="MyEntity.findByField1OrmXml">
<query>
<![CDATA[
SELECT m
FROM MyEntity m
WHERE
m.field1 = :field1
]]>
</query>
</named-query>
</entity-mappings>
And change the Repository as following
public interface MyEntityRepository extends JpaRepository<MyEntity, String>
{
public Optional<MyEntity> findByField1OrmXml(#Param("field1") String field1);
}
For some Reasons when I use OnTap MasterCard Extension, Any Arabic characters in shippment addresses throws an error:
INVALID_REQUEST: Field [order.avsDetails.billToFirstname] was not in charset [ISO-8859-1]
The extension link :
https://marketplace.magento.com/ontap-module-mastercard.html
Please help.
You can try encoding the data generated in the Builders (inside the Gateway/Request folder) by using plugins.
You can read more how to create plugins here that perform the encoding on all the fields in the builders when needed.
You will create a new module that is doing the modifications needed on the extension you took from the market.
To define your builder in this case your di.xml will look something like:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="\OnTap\MasterCard\Gateway\Request\ShippingDataBuilder">
<plugin name="jsparo_ontap_mastercard_gateway_request_shippingdatabuilder" type="Jsparo\MasterCard\Plugin\Gateway\Request\ShippingDataBuilder" sortOrder="1"/>
</type>
</config>
And the Plugin/Gateway/Request/ShippingDataBuilder.php that you will be something like:
<?php
namespace Jsparo\MasterCard\Plugin\Gateway\Request;
class ShippingDataBuilder {
public function afterBuild(array $subject, $result) {
array_walk_recursive($result, function(&$value) {
$value = mb_convert_encoding($value, 'ISO-8859-1', 'UTF-8');
}
return $result;
}
}
You will have to do this for all the builders that generate incorrect data.
I have 2 stores English and Arabic. Default Store is Arabic and default currency is SAR. Currency symbol is showing fine on English Store but not showing anywhere on Arabic store. It only showing price like this 44 on product listing page and on single product page.
I fixed it.
Posting my answer may be it can help someone.
edit this file.
vendor\magento\zendframework1\library\Zend\Locale\Data\ar_SA.xml
and remove following code.
<numbers>
<currencyFormats numberSystem="latn">
<currencyFormatLength>
<currencyFormat type="standard">
<pattern>¤#0.00</pattern>
</currencyFormat>
</currencyFormatLength>
</currencyFormats>
</numbers>
UPDATED ANSWER ========
I got better solution instead editing core file you can do it with observer.
Vendor/Module/etc/events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
<event name="currency_display_options_forming">
<observer name="change_currency_position" instance="Vendor\Module\Model\Observer\ChangeCurrencyPosition" />
</event>
</config>
and observer File.
use Magento\Framework\Event\ObserverInterface;
class ChangeCurrencyPosition implements ObserverInterface
{
public function execute(\Magento\Framework\Event\Observer $observer)
{
$currencyOptions = $observer->getEvent()->getCurrencyOptions();
$currencyOptions->setData('position', \Magento\Framework\Currency::RIGHT);
return $this;
}
}
Need to change the 'position' to RIGHT.
Its a bug in 2.4.3:
src\vendor\magento\module-directory\Model\Currency.php
Comment out these lines:
if ($this->canUseNumberFormatter($options)) {
return $this->formatCurrency($price, $options);
}
Then:
php -dmemory_limit=6G bin/magento setup:upgrade
php -dmemory_limit=6G bin/magento setup:di:compile
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f
php -dmemory_limit=6G bin/magento cache:flush
Editing core is bad, we can create preference.
If #Ask4Tec's solution is not working
Try this
Copy the currency and numbers block from en.xml file and paste it into the ar_SA.xml file
Clean and flush cache
Check after hard refresh
Update ar_SA.xml like below:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE ldml SYSTEM "../../common/dtd/ldml.dtd">
<!-- Copyright © 1991-2013 Unicode, Inc.
CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/)
For terms of use, see http://www.unicode.org/copyright.html
-->
<ldml>
<identity>
<version number="$Revision: 9287 $"/>
<generation date="$Date: 2013-08-28 21:32:04 -0500 (Wed, 28 Aug 2013) $"/>
<language type="ar"/>
<territory type="SA"/>
</identity>
<dates>
<calendars>
<calendar type="islamic">
<dateTimeFormats>
<availableFormats>
<dateFormatItem id="Md" draft="contributed">M/d</dateFormatItem>
<dateFormatItem id="MEd" draft="contributed">E, M/d</dateFormatItem>
<dateFormatItem id="MMMd" draft="contributed">MMM d</dateFormatItem>
<dateFormatItem id="MMMEd" draft="contributed">E, MMM d</dateFormatItem>
</availableFormats>
</dateTimeFormats>
</calendar>
</calendars>
</dates>
<numbers>
<symbols numberSystem="latn">
<decimal>.</decimal>
<group>,</group>
<list>;</list>
<percentSign>%</percentSign>
<plusSign>+</plusSign>
<minusSign>-</minusSign>
<exponential>E</exponential>
<superscriptingExponent>×</superscriptingExponent>
<perMille>‰</perMille>
<infinity>∞</infinity>
<nan>NaN</nan>
</symbols>
<decimalFormats numberSystem="latn">
<decimalFormatLength>
<decimalFormat>
<pattern>#,##0.###</pattern>
</decimalFormat>
</decimalFormatLength>
</decimalFormats>
<currencyFormats numberSystem="latn">
<currencyFormatLength>
<currencyFormat type="standard">
<pattern>¤#,##0.00</pattern>
</currencyFormat>
<currencyFormat type="accounting">
<pattern>¤#,##0.00;(¤#,##0.00)</pattern>
</currencyFormat>
</currencyFormatLength>
<unitPattern count="one">{0} {1}</unitPattern>
<unitPattern count="other">{0} {1}</unitPattern>
</currencyFormats>
<currencies>
<currency type="USD">
<displayName>US Dollar</displayName>
<displayName count="one">US dollar</displayName>
<displayName count="other">US dollars</displayName>
<symbol>$</symbol>
</currency>
</currencies>
</numbers>
</ldml>
I'm having trouble doing XQuery mapping. The error reads as follows:
Error at analyzing XML: {err}FORG0005: expected exactly one item, got 0 items.
This is the response document I recieve:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:cgi="http://tempuri.org/Servicios/CGI"/>
<soap:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<GetConsumosResponse xmlns="http://tempuri.org/Servicios/CGI">
<GetConsumosResult>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Consumos diffgr:id="Consumos1" msdata:rowOrder="0">
...
</Consumos>
...
</NewDataSet>
</diffgr:diffgram>
</GetConsumosResult>
</GetConsumosResponse>
</soap:Body>
</soapenv:Envelope>
In my OSB console I have the following binding...
Replace [ entire node ] of [ . ]
in [ getConsumosResponse ] with [ XQuery Resource... ]
XQuery resource: OSBSettlementProxy/XQuery/NGCombustibleXQResponse
Variable names and bindings:
newDataSet1: $getConsumosResponse/GetConsumosResponse/GetConsumosResult/diffgr:diffgram/NewDataSet
I already defined the diffgr in my namespaces, so I know that is not the problem...
It looks like GetConsumosResponse and GetConsumosResult are in the default namespace http://tempuri.org/Servicios/CGI. However, it looks like your path expression doesn't use this namespace. You might try adding a new namespace definition "cgi"="http://tempuri.org/Servicios/CGI" and then change your path to this:
$getConsumosResponse/cgi:GetConsumosResponse/cgi:GetConsumosResult/diffgr:diffgram/NewDataSet